Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why can't I connect to a database???

Status
Not open for further replies.

BillyC

Programmer
Jul 6, 2000
2
CA
Can anyone help?<br><br>I just can't seem to get a connection to the database that is running in my web.&nbsp;&nbsp;There is a database connection that is active but I get an error here:<br><br>objRS.Open &quot;[SQL Line]&quot;, &quot;ConnectionName&quot;<br><br>Any help or useful resource link for this type of thing would be very helpful.<br><br>thanks..
 
I don't know why you cannot connect to database - it could be anything, may be even not your code.<br>That is what I use almost always to connect to SQL Server:<br><br>1.Dim oRS,strSQL,oConn,strConn<br>2.Set oConn = server.createobject(&quot;ADODB.Connection&quot;)<br>3.strConn = &quot;driver={SQL Server};uid=valid user id goes here;pwd=valid password goes here;database=valid database name goes here;&quot;(don't forget semicolons)<br>4.oConn.open(strConn)<br>5.strSQL = &quot;some sql statement&quot;<br>6.set oRS = oConn.execute(strSQL)<br><br>Works just fine<br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top