Can any one help me with the code of
connecting to MSSql database … but in ASP not ASP.NET ?!
Please …
I realy need the code of connecting for my first project ..
with my best wishes , :))
Can any one help me with the code of
connecting to MSSql database … but in ASP not ASP.NET ?!
Please …
I realy need the code of connecting for my first project ..
with my best wishes , :))
[QUOTE=hussein_bahadi]
Can any one help me with the code of
connecting to MSSql database … but in ASP not ASP.NET ?!
Please …
I realy need the code of connecting for my first project ..
with my best wishes , :))
[/QUOTE]
Try this site: http://www.connectionstrings.com/
[font=Fixedsys]<%[/font]
[font=Fixedsys]'This is the connection object[/font]
[font=Fixedsys]Dim objADODbCon[/font]
[font=Fixedsys]Set objADODbCon = Server.CreateObject(“ADODB.Connection”)[/font]
[font=Fixedsys]'Logon details[/font]
[font=Fixedsys]Const strSQLServer = “adress/ip to the sql server”[/font]
[font=Fixedsys]Const strSQLServerDataBase = “name of the database”[/font]
[font=Fixedsys]Const strSQLServerUser = “name of a user with read and write permissions to the database”[/font]
[font=Fixedsys]Const strSQLServerPassword = “password to the selected user”[/font]
[font=Fixedsys]'Open the connection[/font]
[font=Fixedsys]objADODbCon.Open “Provider=SQLOLEDB;Server=” & strSQLServer & “;User ID=” & strSQLServerUser & “;Password=” & strSQLServerPassword & “;Database=” & strSQLServerDataBase & “;”[/font]
[font=Fixedsys]%>[/font]
also remember to close the connection on the end of the pages:
[font=Fixedsys]<%[/font]
[font=Fixedsys]'Reset the recordset object[/font]
[font=Fixedsys]Set = Nothing[/font]
[font=Fixedsys]'Close the connection[/font]
[font=Fixedsys]objADODbCon.Close[/font]
[font=Fixedsys]'Reset connection object[/font]
[font=Fixedsys]Set objADODbCon = Nothing[/font]
[font=Fixedsys]%>[/font]
[QUOTE=DirtBag]
[font=Fixedsys]<%[/font]
[font=Fixedsys]'This is the connection object[/font]
[font=Fixedsys]Dim objADODbCon[/font]
[font=Fixedsys]Set objADODbCon = Server.CreateObject(“ADODB.Connection”)[/font]
[font=Fixedsys]'Logon details[/font]
[font=Fixedsys]Const strSQLServer = “adress/ip to the sql server”[/font]
[font=Fixedsys]Const strSQLServerDataBase = “name of the database”[/font]
[font=Fixedsys]Const strSQLServerUser = “name of a user with read and write permissions to the database”[/font]
[font=Fixedsys]Const strSQLServerPassword = “password to the selected user”[/font]
[font=Fixedsys]'Open the connection[/font]
[font=Fixedsys]objADODbCon.Open “Provider=SQLOLEDB;Server=” & strSQLServer & “;User ID=” & strSQLServerUser & “;Password=” & strSQLServerPassword & “;Database=” & strSQLServerDataBase & “;”[/font]
[font=Fixedsys]%>[/font]
also remember to close the connection on the end of the pages:
[font=Fixedsys]<%[/font]
[font=Fixedsys]'Reset the recordset object[/font]
[font=Fixedsys]Set = Nothing[/font]
[font=Fixedsys]'Close the connection[/font]
[font=Fixedsys]objADODbCon.Close[/font]
[font=Fixedsys]'Reset connection object[/font]
[font=Fixedsys]Set objADODbCon = Nothing[/font]
[font=Fixedsys]%>[/font]
[/QUOTE]
Might want to throw in the network library and the initial catalog info as well.
[size=1]“Provider=SQLOLEDB;Persist Security Info=False;User ID=user_name;PWD=*****;Initial Catalog=user_databasename;Data Source=mssql1.jodoshared.com;Network Library=DBMSSOCN”
Tonto
[/size]