1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

prepared statement for MySql database

Discussion in 'C#' started by boba5555, Apr 6, 2008.

  1. #1
    Are there exist prepared statements for MySql databases that can be used through ASP. I have this code
            Dim conn
    	Set conn = Server.CreateObject("ADODB.Connection")
    	conn.Open "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=server_name; Port=3306; DATABASE=db_name; UID=un;PASSWORD=pwd; OPTION=4"
            Dim rs
            Dim dbCommand
    	Set dbCommand = Server.CreateObject("ADODB.Command")
    	Set dbCommand.ActiveConnection = conn
    	dbCommand.CommandType = adCmdText
    	dbCommand.CommandText = "SELECT username, password, autcode FROM users WHERE username=? AND password=?"
    	dbCommand.Parameters.Append (dbCommand.CreateParameter("username", adChar, adParamInput, Len(username), username))
    	dbCommand.Parameters.Append (dbCommand.CreateParameter("password", adChar, adParamInput, Len(password), password))
    	Set rs = dbCommand.Execute
    Code (markup):
    but at line
    dbCommand.CommandType = adCmdText
    Code (markup):

    I am getting error mesage:
    "ADODB.Command error '800a0bb9'

    Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. "

    Can someone help me? Thank you in advance.
    boba5555, Apr 6, 2008 IP
  2. InfoSmith

    InfoSmith Peon

    Likes Received:
    Best Answers:
    Trophy Points:
    Did you set value to adCmdText?
    InfoSmith, Apr 6, 2008 IP