Inner Join problem: Urgent
Hi every body
I have tried to retrieve data from two tables and display on the browser with the edit and delete links. So far i have done well. But when i have tried to click on edit link, in order to edit this record(s) by using BillCode as an ID. But the problem is that it seemsthat sql syntex error exists here.
Look at the code, please
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim oRSmt 'Holds the recordset for the record to be updated
Dim sqlText 'Holds the SQL query for the database
Dim UserID 'Holds the record number to be updated
'Read in the record number to be updated
UserID=Request.QueryString("BillCode")
'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DSN=Appo"
Set oRSmt = Server.CreateObject("ADODB.Recordset")
sqlText= "SELECT Appointment.BillCode, Appointment.Lname" Appointment.Fname, Appointment.Tel,Appointment.Time_reserved, Billing.Paid "
sqlText= sqlText & "FROM Appointment INNER JOIN Billing ON Appointment.BillCode = Billing.BillCode WHERE BillCode=" & UserID &""
'Open the recordset with the SQL query
oRSmt.Open sqlText, adoCon
%>
|