Hello friends

May i know how to connect a database to a web page??

Hi,
Use the following method.

set oConno = Server.CreateObject("ADODB.Connection")
set oRsMain = Server.CreateObject("ADODB.Recordset")
oConno.ConnectionString = "Provider=SQLOLEDB;Data Source=[servername];Initial Catalog=[database];User Id=[userid];Password=[password]"
oConno.Open

Hi,
Use the following method.

set oConno = Server.CreateObject("ADODB.Connection")
set oRsMain = Server.CreateObject("ADODB.Recordset")
oConno.ConnectionString = "Provider=SQLOLEDB;Data Source=[servername];Initial Catalog=[database];User Id=[userid];Password=[password]"
oConno.Open

HI vicky_rawat,

I am very much glad with ur answer for my question.


But i dont know where to write this code??How to write?and how to connect ??And i dont what to fill in the spaces i.e., Brackets.

Could u please send me the entire code with full details and one more thing is that i created a web page with login form and register form but i dont know how to connect to the database and how to retrieve data and insert all these things Could u please tell all those details..i visited so many sites i am not able to under stand could u please let me know.


regards
vinay

Hi vinay,

I am really sorry, but first you need to start learning ASP, as nobody here will do the spoonfeeding.

you need to first understand ADO.
Then the connection oject recordset object and then how to write connection string.

We can help you, if you get stuck somewhere.

This article has been dead for over six months. Start a new discussion instead.