Results 1 to 3 of 3

Thread: Database

  1. #1
    Sharon Guest

    Default Database

    I am trying to information out of a database and I don&#039t think I am doing it right. The Connection to the database works, but it does not like my SQL statement. I have a main page were I have my statement and it looks like this:<BR>DataCon2.CommandText= "SELECT eventname FROM TblEvent WHERE criteria="&strMonth.<BR>then on the next page where I want to view it I have my querystring that looks like:<BR>strMonth=Request.QueryString("Month")<BR> and then I have the same SQL statement:<BR>DataCon2.CommandText= "select eventname from TblEvent where criteria="&strMonth<BR>Am I doing this all wrong, can I get some helpful hints on how to fix my problem<BR><BR>Thanks<BR>Sharon<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Database

    I am not sure what kind of error you are getting. Is it just not pulling any data or are you getting some type of error message such as wrong number of paramaters. I can&#039t give a definiive answer without knowing the error but here are some hints.<BR>The syntax depends on what type of field criteria is. If it is a numberic field the syntax looks correct to me. If it is a text field it should be<BR> DataCon2.CommandText= "select eventname from TblEvent where criteria=&#039"&strMonth & "&#039"<BR><BR><BR>If you are just not pulling any data try a response.write on strmonth to make sure you are pulling in what you want.<BR><BR>Good luck<BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Database

    If strMonth is actually a string "July" then you need something like this...<BR><BR>DataCon2.CommandText= "select eventname from TblEvent where criteria=&#039" & strMonth & "&#039"<BR><BR>Then you&#039re doing something like<BR><BR>set rs = Datacon2.Execute ?<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts