problems accessing a database

Results 1 to 3 of 3

Thread: problems accessing a database

  1. #1
    Join Date
    Dec 1969
    Posts
    59

    Default problems accessing a database

    Hey all you ASP experts! I&#039m a newbie, just learning now, and I&#039m rather stuck on something. Info&#039s below:<BR><BR>First things first. Here&#039s my code:<BR><BR>&#060;%<BR>set ConnObj = Server.CreateObject("ADODB.Connection")<BR>Set RstObj = Server.CreateObject("ADODB.Recordset")<BR> <BR>RstObj.CursorType = 0<BR>RstObj.LockType = 1<BR>ConnObj.Mode = 1<BR>If Request.Form = "" then %&#062;<BR><BR>&#060;HTML&#062;<BR>&#060;head&#062 ;<BR>&#060;title&#062;&#060;/title&#062;<BR>&#060;/head&#062;<BR>&#060;body bgcolor="white"&#062;<BR><BR>&#060;H1&#062;Input your User Number.&#060;/H1&#062;<BR><BR>&#060;FORM Method=POST&#062;<BR>&#060;INPUT name="no"&#062;<BR><BR><BR>&#060;INPUT type=submit&#062;<BR>&#060;/FORM&#062;<BR><BR>&#060;/body&#062;<BR>&#060;/HTML&#062;<BR><BR>&#060;%else<BR>name=Request.Form ("no")<BR>ConnObj.Open "sandra-site" <BR>SQLstatement = "SELECT DISTINCTROW resumetable.* FROM resumetable WHERE (((resumetable.no)=&#039" & no & "&#039))"<BR><BR>ConnObj.Execute(SQLstatement)<BR> %&#062;<BR><BR>&#060;HTML&#062;<BR>&#060;head&#062 ;<BR>&#060;title&#062;&#060;/title&#062;<BR>&#060;/head&#062;<BR>&#060;body bgcolor="#CCCCCC"&#062;<BR><BR>Your Vistor Number is &#060;%=RstObj("no")%&#062;<BR><BR>&#060;/HTML&#062;<BR>&#060;%end if%&#062;<BR><BR><BR>&#060;%<BR>ConnObj.Close<BR>S et ConnObj = Nothing<BR><BR>RstObj.Close<BR>Set RstObj = Nothing<BR>%&#062;<BR><BR>Next, here&#039s my error message:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e07&#039 <BR>[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression. <BR>/asp/testit.asp, line 32 <BR><BR><BR>and here&#039s what I&#039m trying to do:<BR><BR>This is a script I&#039ve been working on. All I want to do is access an Access database, which has a table in it (resumetable). Each entry into my table has a user ID (field name is "no") I can&#039t get this stupid script to work. Here&#039s the error message I keep getting:<BR><BR>also, and this is REALLY important:<BR><BR>About the close thingy&#039s at the end -- I need those there. If I don&#039t close out all my asp scripts that access a database, I get fined $500 by my hosting co. Don&#039t know if that&#039s messing this up or not.<BR><BR>Thanks in advance good people! If anyone wants to contact me ABOUT THIS, off the message board, my email is :<BR><BR>leighx.dragoon@intel.com<BR><BR>

  2. #2
    KPW Guest

    Default RE: problems accessing a database

    Shouldn&#039t your SQLstatement be<BR><BR>"SELECT DISTINCTROW resumetable.* FROM resumetable WHERE (((resumetable.no)=&#039" & name & "&#039))"<BR><BR>since you assigned Request.Form("no") to the variable "name"?<BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    59

    Default RE: problems accessing a database

    Thank you so much for your help! I&#039m trying your suggestion out right now! Again -- thanks a lot! :)

Posting Permissions

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