G
Guest
I am attempting to write a web page using VBScript that is supposed to call a
function in a Microsoft Access "class module". Basically, I have a "mdb" file
that contains a database as well as various modules. These modules contain
functions that I'd like to call from the web page based on events that occur
on the web page (i.e. a button click).
As an overview of my environment, I am using Access 2002 on the Windows XP
Professional operating system. I have installed the latest version of IIS and
I am running the web page on the localhost.
I have been working for a week on this and I have made very little progress.
I have tried just about anything you can think of but I'm getting an error
that I can't find a work-around for.
In the Access module "BizRuleCode", there is a function named "testme". Here
is the code I am using to try and execute "testme" using VBScript:
<SCRIPT language="vbscript">
Sub test3()
MsgBox "Running test3..."
Set appAccess = CreateObject("Access.Application")
appAccess.opencurrentdatabase
"C:\Inetpub\wwwroot\BizRulesProject\bizrules.mdb"
appAccess.Visible = True
appAccess.DoCmd.OpenModule "BizRuleCode"
MsgBox "Try to run testme in BizRuleCode...."
appAccess.DoCmd.OpenModule "BizRuleCode", "testme"
'run the function
appAccess.DoCmd.RunCode acCmdRun
Set appAccess = Nothing
MsgBox "Done!"
If Err.Number <> 0 Then
Response.Write "<P><B>The following Error has occured:</B></P>"
Response.Write "Number: " & Err.Number & "<BR>"
Response.Write "Description: " & Err.Description & "<BR>"
Response.Write "Source: " & Err.Source & "<BR>"
Err.Clear
End If
End Sub
</SCRIPT>
The error I get when trying to execute this function is:
"ActiveX component can't create object: 'Access.Application'"
I searched the Internet and MSDN and I found several articles that addressed
this message (error 429), but it related to Visual Basic and not VBScript. I
have tried to register various DLLs (msado15.dll, dao360.dll) using
"regsvr32" and I still get the error. I have also checked and double checked
the "References" that the database/modules are using.
Can anyone take a look at the code I provided and see if I am missing
something?
Thanks,
Matt
function in a Microsoft Access "class module". Basically, I have a "mdb" file
that contains a database as well as various modules. These modules contain
functions that I'd like to call from the web page based on events that occur
on the web page (i.e. a button click).
As an overview of my environment, I am using Access 2002 on the Windows XP
Professional operating system. I have installed the latest version of IIS and
I am running the web page on the localhost.
I have been working for a week on this and I have made very little progress.
I have tried just about anything you can think of but I'm getting an error
that I can't find a work-around for.
In the Access module "BizRuleCode", there is a function named "testme". Here
is the code I am using to try and execute "testme" using VBScript:
<SCRIPT language="vbscript">
Sub test3()
MsgBox "Running test3..."
Set appAccess = CreateObject("Access.Application")
appAccess.opencurrentdatabase
"C:\Inetpub\wwwroot\BizRulesProject\bizrules.mdb"
appAccess.Visible = True
appAccess.DoCmd.OpenModule "BizRuleCode"
MsgBox "Try to run testme in BizRuleCode...."
appAccess.DoCmd.OpenModule "BizRuleCode", "testme"
'run the function
appAccess.DoCmd.RunCode acCmdRun
Set appAccess = Nothing
MsgBox "Done!"
If Err.Number <> 0 Then
Response.Write "<P><B>The following Error has occured:</B></P>"
Response.Write "Number: " & Err.Number & "<BR>"
Response.Write "Description: " & Err.Description & "<BR>"
Response.Write "Source: " & Err.Source & "<BR>"
Err.Clear
End If
End Sub
</SCRIPT>
The error I get when trying to execute this function is:
"ActiveX component can't create object: 'Access.Application'"
I searched the Internet and MSDN and I found several articles that addressed
this message (error 429), but it related to Visual Basic and not VBScript. I
have tried to register various DLLs (msado15.dll, dao360.dll) using
"regsvr32" and I still get the error. I have also checked and double checked
the "References" that the database/modules are using.
Can anyone take a look at the code I provided and see if I am missing
something?
Thanks,
Matt