PDA

Click to See Complete Forum and Search --> : how do i connect to my sql database ?? whats wrong with my code


johnnyboy23
Jan 16th, 2001, 09:09 PM
using vb scipt

Sub OpenDatabase(ByRef dbConn)
Set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.ConnectionTimeout = 15
dbConn.CommandTimeout = 30
dbConn.Open "PWD=sa;DATABASE=bnw"


what have i done wrong???

i always get an error when trying access it this way????
this code comes from my

code.inc file that i call up on every use that i want to open my SQL7 database ??
the name of my database is BNW
my server is nt004
password for it is sa

maybe coz i have not included my server nt004 in it??

how do i do this????

Clunietp
Jan 16th, 2001, 10:12 PM
You must specify a provider and a data source

try this
dbConn.Open "Provider=SQLOLEDB;Data Source=NT004;UID=UserNameHere;PWD=sa;DATABASE=bnw"