|
-
Apr 30th, 2001, 10:55 AM
#1
Thread Starter
Member
SQL connection (easy)
Everybody seems to use connections like this for SQL Server:
<code>
dim objCN as ADODB.Connection
set objCN = new ADODB.Connection
objCN.Open "Provider=SQLOLEDB;Data Source=Server Name;UID=UserName;PWD=Password;Database=MyDatabase"
</code>
When I try to run it, I get an user-defined type not defined error. I think I just need to add the right component to my project, but don't know which one. Please help. Thank you all.
-
Apr 30th, 2001, 11:01 AM
#2
Addicted Member
Hi,
You need to add a reference to Microsoft ActiveX Data Objects 2.x to your VB project.
Hope this helps
S@NSIS
Web/Application Developer
VB6 Ent (SP5), Win 2000,SQL Server 2000
-
Apr 30th, 2001, 11:04 AM
#3
Thread Starter
Member
Ummm...
What if that's not an option in my list of components?
-
Apr 30th, 2001, 11:06 AM
#4
Addicted Member
Hi,
It won't be in your list of components it will be in your list of references (just above components in the menu).
If it isn't in there you will need to download the latest MDAC from the Microsoft site (currently version 2.6)
Hope this helps
S@NSIS
Web/Application Developer
VB6 Ent (SP5), Win 2000,SQL Server 2000
-
Apr 30th, 2001, 11:06 AM
#5
Thread Starter
Member
Never Mind
I was looking in components instead of references. You are the man and deserve great rewards of sweet foods and plump women.
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
|