drop a ADO Data control on your form, use the connection string property to build the connection string, then cut and copy the string and remove the control.
Or paste the following into a file with .vbs as extension. Double click the file and the datalink dialog will pop up.
The code was originally posted in an other forum - but I couldn't find it agian. I did not write this code.
********************************************************
Dim oDataLinks, sRetVal
set oDataLinks = CreateObject("DataLinks"
On Error Resume Next
sRetVal = oDataLinks.PromptNew
On Error Goto 0
If Not IsEmpty(sRetVal) Then
InputBox "Your Connection String Is Listed Below", "OLEDB Connection String", sRetVal
End If
Set oDataLinks = Nothing
********************************************************
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
Or you can use this method which is much easier,
Syntax:
strCon="DRIVER={SQL SERVER};SERVER=SERVER_Name;UID=userID;PWD=password;Database=databa"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.