I don't have ASP setup to try it, but what if you make a Query in Access
which internally calls the vba code & then call that from the ASP?
such as
MyTestQuery =
INSERT INTO TableName(col1, col1, col3) VALUES( @param1, @param2,
MyFunc(@param1,@param1) )
in ASP:
Dim connStr
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=" & Server.MapPath("MyDB.mdb")
' Connection Object
Dim con
Set con = Server.CreateObject("ADODB.Connection")
' connecting to database
con.Open connStr
' executing stored procedure
con.Execute "exec MyTestQuery 'valu1', 'value2', 'value3', 'value4' "
' closing connection and freeing resources
con.Close
Set con = Nothing
Would this work ?
"Bob Barrows [MVP]" wrote:
Alain Bourgeois wrote:
Is it possible to call a vba function inside an asp sql statement?
No, it is impossible to call user-defined VBA procedures from any
external application, including asp. It's been a thorn in our sides for
years. You will need to find another way to accomplish your task.
For this specific purpose, you don't need a user-defined function.
Without knowing the datatypes of col1 and col2, I cannot be specific,
but I'm sure you can do this conversion in your query without a
user-defined function.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.