C
Christopher Brandsdal
Hi!
Just had to convert a asp website I have from Acces to MS SQL Express.
Is this an OK way to connect to the database?
It works great, but I just wanted to know if this is the best way to do
it....
The code runs on the same surver as the sql express server.
AdoConnection = "Provider=SQLOLEDB.1; Data Source=xxx.xx.xxx.xxx;Initial
Catalog=DatabaseName;Persist Security Info=True;User ID=sa;Password=Pass"
ConnectString = AdoConnection
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnectString
sqlBruker = "SELECT Fornavn FROM Bruker"
Set rsBruker = Server.CreateObject("ADODB.Recordset")
rsBruker.Open sqlBruker, conn, 3, 3
Response.Write(rsBruker("Fornavn"))
rsBruker.close
set rsBruker=nothing
Best regards,
Christopher Brandsdal
Just had to convert a asp website I have from Acces to MS SQL Express.
Is this an OK way to connect to the database?
It works great, but I just wanted to know if this is the best way to do
it....
The code runs on the same surver as the sql express server.
AdoConnection = "Provider=SQLOLEDB.1; Data Source=xxx.xx.xxx.xxx;Initial
Catalog=DatabaseName;Persist Security Info=True;User ID=sa;Password=Pass"
ConnectString = AdoConnection
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnectString
sqlBruker = "SELECT Fornavn FROM Bruker"
Set rsBruker = Server.CreateObject("ADODB.Recordset")
rsBruker.Open sqlBruker, conn, 3, 3
Response.Write(rsBruker("Fornavn"))
rsBruker.close
set rsBruker=nothing
Best regards,
Christopher Brandsdal