Home > Archive > MS SQL Server ODBC > August 2005 > Using SQLConfigDatasource/SQLInstallerError/etc - can't find documentation









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Using SQLConfigDatasource/SQLInstallerError/etc - can't find documentation
Keith

2005-06-28, 11:23 am

Hello,

I'm using the functions exposed in ODBCCP32.dll via C# ([DLLImport
("ODBCCP32.dll")]), but am having trouble figuring out what the return/error
codes are. The .dll isn't COM so I can't just add a reference to it. The
docs provide the names of the codes (like ODBC_ERROR_REQUEST_F
AILED) but I
can't find the actual VALUE of that error. I've tried looking for a header
file or another .dll where they might be defined but no luck.

Could someone point me in the right direction, ideally to where all of these
constants are defined? Not just the errors, for also the constants used as
parameters like ODBC_ADD_DSN?

Thanks!

Keith


sbeu

2005-08-03, 8:23 pm


Hi
I've hardly managed to use the SQLConfigDataSource function in order to
create System or user DSNs
here is how I use it into Delphi:
first, import the function :
function SQLConfigDataSource (hwndParent : Integer; fRequest :
Longint;
lpszDriver : AnsiString;
lpszAttributes : AnsiString): Longint;stdcall;exte
rnal
'ODBCCP32.DLL' name 'SQLConfigDataSource
' ;
Second, the constants:
Const
ODBC_ADD_DSN = 1;
ODBC_CONFIG_DSN = 2;
ODBC_REMOVE_DSN = 3;
ODBC_ADD_SYS_DSN = 4;
vbAPINull = 0;
DriverSQLServer:Ansi
String='SQL Server';
then you call it:
SQLConfigDataSource(
vbApiNull,ODBC_ADD_S
YS_DSN,DriverSQLServ
er,StrAttributes);

Well... Now you may change DriverSQLServer string in order to use
another odbc driver.
According to the odbc driver you use, the string StrAttributes may
change. It contains the connection string to the database. Watch this
website: http://www.connectionstrings.com/
it contains the specific connection strings for almost every database.

Send me feedback!
boisseau. xavier__________000@
gmail.commm

remove the _ and the 0 and the last m to reply to my email.
thank you

Keith wrote:
> *Hello,
>
> I'm using the functions exposed in ODBCCP32.dll via C# ([DLLImport
> ("ODBCCP32.dll")]), but am having trouble figuring out what the
> return/error
> codes are. The .dll isn't COM so I can't just add a reference to it.
> The
> docs provide the names of the codes (like ODBC_ERROR_REQUEST_F
AILED)
> but I
> can't find the actual VALUE of that error. I've tried looking for a
> header
> file or another .dll where they might be defined but no luck.
>
> Could someone point me in the right direction, ideally to where all
> of these
> constants are defined? Not just the errors, for also the constants
> used as
> parameters like ODBC_ADD_DSN?
>
> Thanks!
>
> Keith *




--
sbeu
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message1702039.html

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com