0

Hello I trying to get the email address from the database and input it to the asp code or html. I was able to read the email address from the database but not able to store the value. How can I store the value? Response.Write bs("email_addr") its reading from the database. But when added Set storeEmail = response.Write bs("email_addr") it gives me error message Microsoft VBScript compilation error '800a0401'

Expected end of statement line 44 which is Set storeEmail = Response.Write bs("email_addr"). Please help im new with asp. Thanks

   DIM objConn, bs, ossql
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open "Provider=MSDASQL.1;Password=**;Persist Security Info=True;User ID=**;Data Source=**"
    ossql = "SELECT email_addr FROM user WHERE username = '" & strUsername & "' AND system_code= '" & strHealth & "' AND facility_code = '"& strFacility & "'"
    Set bs = objConn.Execute(ossql)

    DIM storeEmail
    Response.Write bs("email_addr")
2
Contributors
1
Reply
8
Views
2 Years
Discussion Span
Last Post by hericles
0

Response.write outputs the value to the HTTP stream. It is a different action entirely than reading a value so it can be stored in a variable. So your code is looking for something to end this command:
Set storeEmail =
Before it moves onto the Response.Write.
This should be all you need.
Set storeEmail = bs("email_addr);

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.