I'm having some trouble programming a simple ActiveX DLL to use for a web site.
Here is my code for the DLL
----------------------------
Option Explicit
Public Function getResponse() As String
Dim db As Database
Dim rsTT As Recordset
Dim strSQL As String
Dim myResponse As String
Set db = OpenDatabase("E:\train.mdb"
strSQL = "select * from Info where ID = 1"
Set rsTT = db.OpenRecordset(strSQL)
myResponse = "Database lookup = " & rsTT.Fields("Name"
rsTT.Close
Set rsTT = Nothing
db.Close
Set db = Nothing
getResponse = myResponse
End Function
-----------------------------
here is my ASP file
-----------------------------
<%
set ServerUtl = server.createobject("ServerUtlEXE.ServerUtl"
response.write ServerUtl.getResponse() <-- WHERE ERROR HAPPENS --
%>
-----------------------------
When I run this ASP file from my web server, it should run the dll file, pull out the name from the database and return it through getResponse... but I'm getting an error.
DAO Workspace
Could not lock file
/test.asp line 3
Does anyone know why this would happen?
This is the first time I've tried accessing a database from an ActiveX dll I've programmed other dlls, and this has never happened.
Please help
Here is my code for the DLL
----------------------------
Option Explicit
Public Function getResponse() As String
Dim db As Database
Dim rsTT As Recordset
Dim strSQL As String
Dim myResponse As String
Set db = OpenDatabase("E:\train.mdb"
strSQL = "select * from Info where ID = 1"
Set rsTT = db.OpenRecordset(strSQL)
myResponse = "Database lookup = " & rsTT.Fields("Name"
rsTT.Close
Set rsTT = Nothing
db.Close
Set db = Nothing
getResponse = myResponse
End Function
-----------------------------
here is my ASP file
-----------------------------
<%
set ServerUtl = server.createobject("ServerUtlEXE.ServerUtl"
response.write ServerUtl.getResponse() <-- WHERE ERROR HAPPENS --
%>
-----------------------------
When I run this ASP file from my web server, it should run the dll file, pull out the name from the database and return it through getResponse... but I'm getting an error.
DAO Workspace
Could not lock file
/test.asp line 3
Does anyone know why this would happen?
This is the first time I've tried accessing a database from an ActiveX dll I've programmed other dlls, and this has never happened.
Please help