Sample Code For Connection String In Asp to MsAccess Database
Example of a DSN connection
<%
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=myCONNECTION.dsn"
objConn.Open
%>
Example of a DSN-Less connection
<%
DIM objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
Server.MapPath ("/YourdatabaseName.mdb") & ";"
objConn.Open
%>
Sample Code For Connection String In Asp to Mssql Server
The sample example code
Set objDBConn = Server.CreateObject("ADODB.Connection")
objDBConn.ConnectionString="driver={SQL Server};" _
& "server=myserver put the serverIP;" _
& "uid=mywebuser Database User ID;" _
& "pwd="YourPassword;"
objDBConn.Open
objDBConn.DefaultDatabase = "mydatabaseDatabaseName"
- 101 Utilizadores acharam útil
Artigos Relacionados
Powered by WHMCompleteSolution