Click to See Complete Forum and Search --> : Connecting to MS2005SQLServer with a VB script?


fatbob_51
04-22-2008, 09:33 AM
Hi!
I just have one or one simple question....how do I connect to a MSSQL2005Express Server with VB(which is my "main-language" in an ASP.net site)?

Not sure if this belongs to the ASP forum...sorry if it isnt:o !



Thanks in advance!

yamaharuss
04-23-2008, 08:31 AM
This should work..

Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open "PROVIDER=SQLOLEDB;" & _
"DATA SOURCE=YOURSERVER;DATABASE=YOURDATABASE;" & _
"USER ID=YOURUSER;PASSWORD=YOURPASSWORD;"