Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Need help on problem with Delphi 3.0 and MS SQL server database

5 views
Skip to first unread message

John Bester

unread,
May 7, 2003, 7:03:07 AM5/7/03
to
Have you added the field names in the fields editor at design time?

--
Regards

John Bester
mailto:john....@adept.co.za

John Bester

unread,
May 12, 2003, 7:51:30 AM5/12/03
to
You probably have a TQuery, TADOQuery, TTable etc on your form, right?
Double click on it (in design time of course). You will get a list (probably
empty). Right click on it and choose "Add all fields". By the way - the list
is the fields editor I was speaking about.

--
Regards

John Bester
mailto:john....@adept.co.za


"Lars-Erik Østerud" <.@.> wrote in message
news:3ebf55fe$1...@news.wineasy.se...
> John Bester skrev:


>
> > Have you added the field names in the fields editor at design time?
>

> I not sure what you mean here ?
>
> I have a SQL server database that is up and running.
> All field have names when I look at it from Enterprise Manager.
> The database has data too, and is used OK from other applications.
> It's only in my Delphi application that the field defs are missing.
>
> --
> Lars-Erik - http://home.chello.no/~larse/ - ICQ # 7297605
>
> Win98se, Asus P4PE, 2.53 GHz, Asus V8420 (Ti4200), SB-Live!


Warren Postma

unread,
May 31, 2003, 11:00:24 AM5/31/03
to
> No form, this is a DLL. So I manually create the database and table
> objects. And with Access this worked great. All definitions was right.


Why not use a Data Module, then you can visually design all your table
objects (add the fields and so on), and still have no visible Forms.
All you have to do then is write one line:
MyMod := TMyDataModule.Create(nil);

JasKik

unread,
Nov 3, 2003, 4:29:18 AM11/3/03
to
Hi Lars,
 
I cannot see you assigning a user name or password which you would need to do to connect to the database. Also remember that you will have to query using select statements and TQuery components.
 
the parameters
 
USER NAME=YOUNAMEHERE

PASSWORD=HowNowBrownCow

or remove the no login prompt clause - see if that works. 

Fundamental differences exist between SQL setups and such things as Access - bear this in mind - I would be surprized if you dont have to do a fairly extensive debug.

regds

 

jon

 

 
 
"Lars-Erik Østerud" <.@.> wrote in message news:3ebfa37e$1...@news.wineasy.se...
> John Bester skrev:

>
> > You probably have a TQuery, TADOQuery, TTable etc on your form, right?
>
> No form, this is a DLL. So I manually create the database and table
> objects. And with Access this worked great. All definitions was right.
>
> Is there a special command I have to do after opening the table with
> an SQL server database to import the definition. Here is my code:
>
>   REPEAT
>     io_ok:=True;
>     TRY
>       ValgDatabase:=TDatabase.Create(Application);
>       ValgDatabase.DatabaseName:='ValgDatabase';
>       ValgDatabase.SessionName:='Default';
>       ValgDatabase.KeepConnection:=True;
>       ValgDatabase.LoginPrompt:=False;
>       ValgDatabase.Params.Clear;
>
> GetPrivateProfileString('Directory','JobFiles','c:\eandh\jobs',job_path,255,'ehlocal.ini');
>       AssignFile(inf,job_path+'\Valg2003.inf');Reset(inf);
>       FOR a:=1 TO 9 DO les_inf_linje;
>       ValgDatabase.DriverName:=les_inf_linje;
>       WHILE Not Eof(inf) DO
>         ValgDatabase.Params.Add(les_inf_linje);
>       CloseFile(inf);
>       ValgDatabase.Params.Add('DATABASE NAME=');
>       ValgDatabase.Params.Add('OPEN MODE=READ/WRITE');
>       ValgDatabase.Params.Add('SCHEMA CACHE SIZE=8');
>       ValgDatabase.Params.Add('SQLQRYMODE=');
>       ValgDatabase.Params.Add('LANGDRIVER=');
>       ValgDatabase.Params.Add('SQLPASSTHRU MODE=SHARED AUTOCOMMIT');
>       ValgDatabase.Params.Add('SCHEMA CACHE TIME=-1');
>       ValgDatabase.Params.Add('MAX ROWS=-1');
>       ValgDatabase.Params.Add('BATCH COUNT=200');
>       ValgDatabase.Params.Add('ENABLE SCHEMA CACHE=FALSE');
>       ValgDatabase.Params.Add('SCHEMA CACHE DIR=');
>       ValgDatabase.Params.Add('ENABLE BCD=FALSE');
>       ValgDatabase.Params.Add('ROWSET SIZE=20');
>       ValgDatabase.Params.Add('BLOBS TO CACHE=64');
>       ValgDatabase.Open;
>       ValgJobbStatusTabell:=TTable.Create(ValgDatabase);
>       ValgJobbStatusTabell.DatabaseName:='ValgDatabase';
>       ValgJobbStatusTabell.TableName:='JobbStatus';
>     EXCEPT
>       ON E:Exception DO io_ok:=FeilMld(E,'åpning av ValgDatabase');
>     END;  {try <åpne database>}
>   UNTIL io_ok;
>
> --
>  Lars-Erik  - 
http://home.chello.no/~larse/  -  ICQ # 7297605
0 new messages