Jump to content

ASP, connect the database


Reachster

Recommended Posts

Well i decided to re-word a previous post topic which did not make any sense, firstly i will ask 1) What code should i use to connect a database to an ASP page2) if i have a sign up page, how do i get that information which people enter to register into my database3) When they login what code do i use to verify their username and password,and lastly 4) Which ASP page do i put the source code that connects to the database. p.s. - -- saying that the name of the MSAccess Database is "details.mdb"------whoever can help and understand me, u really do know ur stuff!! any notes are also appreciated. :) Thnx Reachster -- reach to help me

Link to comment
Share on other sites

if you want to connect a database to an asp paper,i sugest you should follow the following steps:firestly u should creat an object which connects to the database entering in some codes like"set conn=server.CreateObject("adodb.connection")"secondly you open the connection ,entering the codes like"conn.open "dsn=search" it is necessary for you to config your date sourcethirdly creat a recordset adding the codes"set rs=server.CreateObject("adodb.recordset")"i think it can work!sorry,you may hardly understand what i have writen,because of my poor English.English is my second language.I am a Chinese boy,be gladto give help to anyone who needs.that's all!

Link to comment
Share on other sites

I usually use something similar to this

conn_name = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("\path\database.mdb")

Then to connect in your script

Set rs = Server.CreateObject("ADODB.Recordset")rs.ActiveConnection = conn_name

e.g.

<%Set rs = Server.CreateObject("ADODB.Recordset")rs.ActiveConnection = conn_namers.Source = "SELECT TOP 10 user_id, username  FROM [USER]  ORDER BY user_id DESC"rs.CursorType = 0rs.CursorLocation = 2rs.LockType = 1rs.Open()%>



			
		
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...