Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 256
  • Last Modified:

ASP string to long int?

how to change string to long int? or array to long int?
my ID is long integer. but i cannot select out the noID

can anyone tell me whats wrong in this?

dim noID
noID=CInt(newList(0))               'my newList(0) is 4567

<%
set conn = Server.CreateObject("ADODB.Connection")
      conn.Provider="Microsoft.Jet.OLEDB.4.0"
      conn.Open(Server.MapPath("Database.mdb"))
      set rs=Server.CreateObject("ADODB.Recordset")
      rs.Open "SELECT * from member where ID='"& noID &"'", conn
      if err<>0 then
    response.write("No data!")
  else



Error Type:
Microsoft JET Database Engine (0x80040E07)
Data type mismatch in criteria expression.
0
rarilo
Asked:
rarilo
1 Solution
 
venkateshwarrCommented:
>>how to change string to long int? or array to long int?

CLong()

Is the attribute ID string or int. If it is of type int or long int.. you should not put ''

 rs.Open "SELECT * from member where ID="& noID &"", conn
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now