still problems with multiple databases

Results 1 to 2 of 2

Thread: still problems with multiple databases

  1. #1
    Join Date
    Dec 1969

    Default still problems with multiple databases

    Hi sorry to bug again but I still get an error with the following code - I am trying to get a the projno and custcode from the project database where Nickname = &#039nick&#039 from request form but I keep getting Data type mismatch in criteria expression on the line with the *. heres the code :<BR><BR>sql1 = "select Project_No, Cust_Code from project where Nickname = &#039" + Request.Form("nick") + "&#039"<BR>Set obtain = objConn.Execute(sql1)<BR><BR>Do While not obtain.eof<BR>projno = obtain.Fields( "Project_No" ).Value<BR>custcode = obtain.Fields( "Cust_Code" ).Value<BR><BR>Call obtain.MoveNext<BR> Loop<BR> obtain.Close<BR><BR>sql4 = "SELECT D.Project_Type, D.Project_No, D.Nickname, " &_ <BR>"D.Project_Code, D1.COMPANY_NA, D1.Contact_Name, " & _<BR>"D2.Consultant, D2.Date, D2.Task, D2.Comments, D2.Hours, " &_ <BR>"D2.Minutes, D2.Billable, D2.Billed, D2.Rate, " & _<BR>"D2.Km_Travelled, D2.Travel_Rate, D2.Other_Expenses " &_<BR>"FROM project.db D, Cust1.db D1, timesheet.db D2 " &_ <BR>"WHERE (D2.Project_No = &#039" & projno & "&#039) AND (D1.CUST_CODE = &#039" & custcode & "&#039) " &_<BR> "ORDER BY Project_Type, D.Nickname, D.Project_Code, " & "D1.COMPANY_NA, D1.Contact_Name, D2.Consultant, D2.Date, " &_ <BR>"D2.Task, D2.Hours, D2.Minutes, D2.Billable, D2.Billed, " &_ <BR>"D2.Rate, D2.Km_Travelled, D2.Travel_Rate, D2.Other_Expenses"<BR><BR>Set objRS = objConn.Execute(sql4) *<BR><BR>Please can someone help.<BR>Thanks so much<BR>Nick

  2. #2
    Join Date
    Dec 1969

    Default I think just a datatype problem, but...

    You *MUST* put a <BR><BR>&nbsp; Response.Write "&#060;HR&#062;" & sql4 & "&#060;HR&#062;" & vbNewLine<BR><BR>just before your Set objRS line *and* copy/paste it here to show us *exactly* what it looks like. <BR><BR>*THEN* you *must* go to your database schema (the "table design view" in Access, for example) and tell us what the data type of the fields D2.Project_No AND D1.CUST_CODE are. (This still might not get us to the solution, but we certainly won&#039t get there until you do that much.)<BR><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