freejoe76
06-04-2003, 02:01 AM
Hi,
I've been bugging my brain for hours on this and can't come up with a solution.
The situation seems simple: take a request.form variable and return a record from the SQL database using the variable as the key.
Hasn't been so much, though. This is what I have so far:
Dim DataConn, adoCmd, SQL, emailAd, rs 'database-related variable definitions
Set rs = Server.CreateObject("ADODB.Recordset")
Set DataConn = Server.CreateObject("ADODB.Connection")
Set adoCmd = Server.CreateObject("ADODB.Command")
DataConn.Open("Provider=SQLOLEDB; Network Library=dbmssocn; Data Source=; Initial Catalog=;UID=;PWD=")
emailAd = request.form("emailAddress")
With adoCmd
.ActiveConnection = DataConn
.CommandType = adCmdStoredProc
.CommandText = "spRetrieveBillingInfo"
.Parameters.Append .CreateParameter("emailAddress", adVarChar, adParamInput, 80, "test")
End With
Set rs = adoCmd.Execute
But when I call a rs.fields("nameFirst").value later in the page, I get a
ADODB.Field error '800a0bcd'
error.
And for reference, this is the stored procedure:
CREATE PROCEDURE spRetrieveBillingInfo
@emailAddress varchar(80) = null
AS
SELECT * FROM tblCustomer WHERE emailAddress = '@emailAddress'
GO
.... I believe this is the closest I've come to a solution, but it's no means the first method I've tried. I'm still real new to ASP, so any and all help is much much much appreciated.
Thanks
Joe
I've been bugging my brain for hours on this and can't come up with a solution.
The situation seems simple: take a request.form variable and return a record from the SQL database using the variable as the key.
Hasn't been so much, though. This is what I have so far:
Dim DataConn, adoCmd, SQL, emailAd, rs 'database-related variable definitions
Set rs = Server.CreateObject("ADODB.Recordset")
Set DataConn = Server.CreateObject("ADODB.Connection")
Set adoCmd = Server.CreateObject("ADODB.Command")
DataConn.Open("Provider=SQLOLEDB; Network Library=dbmssocn; Data Source=; Initial Catalog=;UID=;PWD=")
emailAd = request.form("emailAddress")
With adoCmd
.ActiveConnection = DataConn
.CommandType = adCmdStoredProc
.CommandText = "spRetrieveBillingInfo"
.Parameters.Append .CreateParameter("emailAddress", adVarChar, adParamInput, 80, "test")
End With
Set rs = adoCmd.Execute
But when I call a rs.fields("nameFirst").value later in the page, I get a
ADODB.Field error '800a0bcd'
error.
And for reference, this is the stored procedure:
CREATE PROCEDURE spRetrieveBillingInfo
@emailAddress varchar(80) = null
AS
SELECT * FROM tblCustomer WHERE emailAddress = '@emailAddress'
GO
.... I believe this is the closest I've come to a solution, but it's no means the first method I've tried. I'm still real new to ASP, so any and all help is much much much appreciated.
Thanks
Joe