 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jan Guest
|
Posted: Tue Jul 11, 2006 7:17 pm Post subject: C++-Builder 5 connecting to SQL-Server |
|
|
Hi,
I am trying to connect to a sql-server in our lan from c++-builder
programmatically.
I am doing this like:
TDatabase *pDB = new TDatabase( Application );
pDB->KeepConnection = true;
pDB->LoginPrompt = false;
pDB->DatabaseName = "db"; / / --> do i have to use an alias here
???
pDB->SessionName = "Default";
pDB->DriverName = "SQL Server";
pDB->Params->Clear();
pDB->Params->Add("SERVER NAME=w2k-server-1.eins-gmbh.de");
pDB->Params->Add("USER NAME=sa");
pDB->Params->Add("PASSWORD=123456");
pDB->Params->Add("DATABASE NAME=dnname");
try
{
pDB->Connected = true;
}
catch(EDBEngineError* dbError)
{
for (int i = 0; i < dbError->ErrorCount; i++)
{
ShowMessage((dbError[i].Message + " error-code: " +
IntToStr(dbError->Errors[i]->ErrorCode)).c_str());
}
}
Is there a working example ??
Is the MSSQL driver available somewhere or must I use the ODBC - SQL
Server - driver?
Do I always have to use an alias?? I did try this but I always get an
"invalid configuration parameter" error code 12550.
Thanks for any answer,
Jan |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|