| Here is an example code extract using VB4:
Note that layout may be affected by the cut and paste.
Declare Function SQLConfigDataSource Lib "odbccp32.dll" _
(ByVal hwnd As Integer, ByVal fRefresh As Integer, ByVal szDriver As
String, _
ByVal szAttributes As String) As Integer
strDriver = "Oracle ODBC Driver for Rdb" & Chr(0)
strAttributes = "Description=NSQT Database" & Chr(0) & _
"Schema=attach 'filename " & txtAttach & "NSQT'" & Chr(0) & _
"User=" & strUserName & Chr(0) & _
"Server=" & txtServerName & Chr(0) & "Options=0" & Chr(0) & _
"Transport=2=tcp/ip" & Chr(0) & "Class=generic" & Chr(0) & _
"Attributes=" & Chr(0) & "Cursor Option=1=NOHOLD" & Chr(0) & _
"Driver=C:\WINDOWS\SYSTEM\SQRDB32.DLL" & Chr(0) & _
"DSN=NSQT_RDB" & Chr(0) & "Options=0" & Chr(0)
iRegAdd = SQLConfigDataSource(0, ODBC_ADD_DSN, strDriver,
strAttributes)
Note first, that this sort of thing is described in the MSDN. Any group
doing serious Windows/MS development is foolish if they do not
subscribe to the MSDN because the wealth of information is so great.
Note second, that the above extract is for ODBC v2.5. It will probably
still work for v3.0 but I'm sure the correct syntax has changed.
Cheers,
Brian
|
| Brian,
WOW, what a screen full...
Thanks,
From what I see in your example, this whole business looks like it is all
in the hands of MS dll's, not any of the dll's the "driver" provides.
My customer was wanting to call ConfigDSN, which is called by the
SQLConfigDataSource function you use. Whatever....
Thanks,
Jerry
|