{I+=codeWee;}
[ASP] How to use Microsoft Access OLE DB(accdb)

1. Install "Microsoft Access Database Engine 2010 Redistributable" (https://www.microsoft.com/en-us/download/details.aspx?id=13255).
2. Create a MS Access file at C:\Database_Test.accdb.



=== Sample ASP Code ===

<%

Set db = Server.CreateObject("ADODB.Connection")

strConnect = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Database_Test.accdb;Jet OLEDB:Database Password=1111;"

db.open strConnect


	SQL = "SELECT * FROM TABLE1"
	Set Rs = Server.CreateObject("ADODB.RecordSet")
	Rs.open SQL,db,3
	Do Until Rs.EOF
%>
			<%=Rs("ID")%>
			<%=Rs("Field1")%>
			<%=Rs("Field2")%>
			<%=Rs("Field3")%>

<%

	Rs.MoveNext
	Loop
	Rs.close
	Set Rs = nothing

%>
HTML | PHP | C++ | DirectX11 | Javascript | C# | HTML5 | ASP | SQL | General | CSS | Oculus Rift | Unity3d | Virtools SDK | Tip | NSIS | PowerShell | node.js | Web API | RTSP | All
Copyright© 2016 CodeWee.com All rights reserved.