I have an application written in Access2k that makes extensive use of stored procedures (ok, paramaterised queries) controlled by a VB script that is essentially a series of ADO command objects of type adStoredProc.
It works very well in native Access, but not in asp.
I am told that the arguments are out of range or in conflict on the line: adoCmd.CommandType=adStoredProcedure and again on the parameter object type.
2 questions then:
The first and most important is does ASP allow stored procedures in Access2K? can anyone see what is wrong with the code below - this example is trivial and could be done with a rs object but I want to use stored procedures for later scaling to SQL Server & just because.
3 - does char have to have a size, and is it the equivalent of a text type in access?
<%
strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("dbMyData.mdb"
'DSN connection (alternative)
'strCon="dsn=dsnMyAccess2kData"
'Set an active connection to the Connection object
adoCon.Open strCon
'Capture some form fields, but we'll just set some variables up for now
Dim strUserName, strEmail
strUserName = "John"
strEmail = "john@smith.name"
Set adoCmd = Server.CreateObject("ADODB.Command"
adoCmd.ActiveConnection = adoCon
adoCmd.CommandText = "qryMemberAddNew"
adoCmd.CommandType = adCmdStoredProc
' set up the parameter objects to pass the data to the stored procedure
Set prmUserName = Server.CreateObject("ADODB.Parameter"
prmUserName.Name = "strUserName"
prmUserName.Type=adChar
prmUserName.Direction=adParamInput
prmUserName.Value = strFirstName
'I've even tried different methods!
Set prmEmail = adoCmd.CreateParameter
prmEmail.Name = "strEmail"
prmEmail.Type = adChar
prmEmail.Direction = adParamInput
prmEmail.Value = strFirstName
%>
It works very well in native Access, but not in asp.
I am told that the arguments are out of range or in conflict on the line: adoCmd.CommandType=adStoredProcedure and again on the parameter object type.
2 questions then:
The first and most important is does ASP allow stored procedures in Access2K? can anyone see what is wrong with the code below - this example is trivial and could be done with a rs object but I want to use stored procedures for later scaling to SQL Server & just because.
3 - does char have to have a size, and is it the equivalent of a text type in access?
<%
strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("dbMyData.mdb"
'DSN connection (alternative)
'strCon="dsn=dsnMyAccess2kData"
'Set an active connection to the Connection object
adoCon.Open strCon
'Capture some form fields, but we'll just set some variables up for now
Dim strUserName, strEmail
strUserName = "John"
strEmail = "john@smith.name"
Set adoCmd = Server.CreateObject("ADODB.Command"
adoCmd.ActiveConnection = adoCon
adoCmd.CommandText = "qryMemberAddNew"
adoCmd.CommandType = adCmdStoredProc
' set up the parameter objects to pass the data to the stored procedure
Set prmUserName = Server.CreateObject("ADODB.Parameter"
prmUserName.Name = "strUserName"
prmUserName.Type=adChar
prmUserName.Direction=adParamInput
prmUserName.Value = strFirstName
'I've even tried different methods!
Set prmEmail = adoCmd.CreateParameter
prmEmail.Name = "strEmail"
prmEmail.Type = adChar
prmEmail.Direction = adParamInput
prmEmail.Value = strFirstName
%>