Hi All,
I am using the following code to create a dsn automatically in my vb6 code.
''''in declarations part:
Private Const a = 4&
Private Declare Function SQLConfigDataSource Lib "ODBCCP32.DLL" _
(ByVal hWndParent As Long, ByVal fRequest As Long, _
ByVal lpszDriver As String, ByVal lpszAttributes As String) _
As Boolean
'''and function call to create dsn:
i = SQLConfigDataSource(0, a, "Microsoft Access Driver (*.mdb)",_ "DSN=MyDsn;DBQ=" & App.Path & "\Data\MyDb.mdb")
The above code works fine in XP. But in vista platform, it is returning 0 to i, ie., the dsn is not getting created. Any advice to resolve this problem will be appreciated.
Thanks