|
-
Jan 28th, 2002, 12:13 PM
#1
Open "ODBC Data Sources (32bit)" control panel item
Okay, I'm a bit new to API stuff, but I've read that you can use an API to open the ODBC dialog.
So I've added :
VB Code:
Private Declare Function SQLManageDataSources Lib "ODBC32.DLL" (ByVal hwnd) As Boolean
at the top of my code, and then included
VB Code:
Private Sub Command1_Click()
SQLManageDataSources (hwnd)
End Sub
within the code.
It don't work, and not being much of an API pro, I don't know what to do!
What's wrong? I bet I've done something stupid!
-
Jan 30th, 2002, 08:37 AM
#2
Hi Steve,
Try this - it worked on my NT box.
VB Code:
Option Explicit
Private Declare Function SQLManageDataSources Lib "ODBCCP32.DLL" (ByVal hwnd As Long) As Boolean
Private Sub Command1_Click()
Dim bln As Boolean
bln = SQLManageDataSources(CLng(Me.hwnd))
End Sub
This world is not my home. I'm just passing through.
-
Jan 30th, 2002, 08:44 AM
#3
It worked on my Win98 box too. Thanks trisuglow
-
Jan 30th, 2002, 08:46 AM
#4
This also works on my Win98 box, and I suspect that if you change the windows directory, it would work on an NT box.
VB Code:
Private Sub Command2_Click()
'ODBC Settings
Shell "C:\Windows\control.exe" & " ODBCCP32.cpl", 1
End Sub
-
Jan 30th, 2002, 08:51 AM
#5
-
Jan 30th, 2002, 10:25 AM
#6
Code:
Shell "odbcad32", vbNormalFocus
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|