After view a number of people's ASP code here and in other forums, I have noticed that some people make connections differently than I do. So I am curios as to the right way to make a connection.
Here is what I do when connecting to something like a MS Access database:
What I have seen others do is:
Any help here?
-Brian-
I'm not an actor, but I play one on TV.
Here is what I do when connecting to something like a MS Access database:
Code:
Dim DBConnection
Dim DBConnectionString
Dim DBRecordSet
Dim DBRecordSetSQL
Set DBConnection = Server.CreateObject("ADODB.Connection")
Set DBRecordSet = Server.CreateObject("ADODB.RecordSet")
DBConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};uid=; DBQ=" & Server.MapPath("northwind.mdb")
DBRecordSetSQL = "SELECT * FROM Orders WHERE Orders.OrderID = 1;"
DBConnection.Open DBConnection String
DBRecordset.Open DBRecordsetSQL, DBConnection
Code:
Dim Recordset
Dim DBConnectionString
Set Recordset = Server.CreateObject("ADODB.Recordset")
DBConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};uid=; DBQ=" & Server.MapPath("northwind.mdb")
Recordset.ActiveConnection = DBConnectionString
Recordset.Source = "SELECT * FROM Orders WHERE Orders.OrderID = 1;"
Recordset1.Open()
-Brian-
I'm not an actor, but I play one on TV.