|
-
Oct 29th, 1999, 06:35 AM
#1
Thread Starter
Hyperactive Member
I got this code from www.planetsourcecode.com and I was wondering exactly where to put it and how to use it, because they weren't very clear.
Public Sub CONNECTODBC()
Dim dbname As String
Dim dataset As String
Dim User3 As String
Dim pass As String
Dim db As Database
Dim X As String
User3 = "USERID"
pass = "PSWD"
dataset = "YOUR DSN NAME"
dbname = "DATABASE NAME"
X = "ODBC;database=" & dbname & ";DSN=" & dataset & ";UID=" & User3 & ";PWD=" & pass
Set db = OpenDatabase("", False, False, X)
db.Close
End Sub
If you could help me figure out exactly how to use it, or figure out a better way to connect to a SQL server, I would appreciate it.
------------------
Thanks,
Ryan
[email protected]
ICQ# 47799046
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
|