| | |
|
Active Server Pages what is asp programming how to sample asp example code scripts software asp forum mail sessions applications global.asa CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
OLE DB SOS |
From: |
Ben Hwa |
Date: |
1/20/2000 3:08:27 AM |
IP: |
165.21.83.156 |
Hello there,
1) I am trying the OLE DB connection with an Access97 db file, password protected. (The Access97 is not install in my machine - NT 4 Workstation with IIS 2.0)
The code is :
<%
dim conn
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/Px/Px_pw.mdb") & ";Password=px"
conn.Open
%>
But encouter the following error :
Microsoft JET Database Engine error 80040e4d
Cannot start your application. The workgroup information file is missing or opened exclusively by another user.
Is it because the Access97 is not install in the machine? Or there is something else?
2) So I remove the password & try the following :
<%
dim conn, cmd, rs
dim sSQL
sSQL = "SELECT Phonebook.ReceipentName, Phonebook.PagerNo, Phonebook.ExtensionNo, DeptPhonebookTbl.DeptName"
sSQL = sSQL & " FROM DeptPhonebookTbl RIGHT JOIN PhoneBook ON DeptPhonebookTbl.ReceipentName = PhoneBook.ReceipentName"
sSQL = sSQL & " WHERE PhoneBook.Hidden = No"
sSQL = sSQL & " Order By Phonebook.ReceipentName"
set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/Px/Px.mdb")
conn.Open
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sSQL, conn, adOpenForwardOnly, adLockReadOnly
do while not rs.eof
Response.Write(rs("ReceipentName")) & ("</BR>")
rs.MoveNext
loop
rs.close
set rs=nothing
conn.c |
|
|

|
|
|
|