This is a discussion on Using SQLConfigDatasource/SQLInstallerError/etc - can't find documentation within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> Hello, I'm using the functions exposed in ODBCCP32.dll via C# ([DLLImport ("ODBCCP32.dll")]), but am having trouble figuring out what ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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_FAILED) 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 |
| ||||
| 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;external '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:AnsiString='SQL Server'; then you call it: SQLConfigDataSource(vbApiNull,ODBC_ADD_SYS_DSN,Dri verSQLServer,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_FAILED) > 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 |