Moving on to SQL Express

  • Thread starter Christopher Brandsdal
  • Start date
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top