|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Connecting To An Access Database Using File DSN And ASP Or ADOThis example describes using File DSN and ASP/ADO to connect to an Access Database. <%
Dim oConn, oRs Dim qry, connectstr, sDSNDir Dim db_name, db_username, db_userpassword Dim db_server, dsn_name dsn_name = "your_dsn_name" fieldname = "your_fieldname" tablename = "your_tablename" sDSNDir = Server.MapPath("_dsn") connectstr = "filedsn=" & sDSNDir & "/" & dsn_name Set oConn = Server.CreateObject("ADODB.Connection") oConn.Open connectstr qry = "SELECT * FROM " & tablename Set oRS = oConn.Execute(qry) if not oRS.EOF then while not oRS.EOF response.write ucase(fieldname) & ": " & oRs.Fields(fieldname) & " " oRS.movenext wend oRS.close end if Set oRs = nothing Set oConn = nothing %> Comments, Questions & Reviews
Comments is currently disabled for this article! Related Articles and Readings
The information provided in this article is for general information and/or the comments is the sole responsibility of their respective authors and does not necessarily reflect the opinion of zeronese.net does not endorse any article and/or comments published by our web users unless otherwise noted. |
Categories
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

