I don’t have any IT people where I work, and it is frustrating to figure these codes out. So thank you for helping me.
Here is the situation: I used 3 tables for qryRep, which is the stored procedure for the following ASP page. However, when I run it, I generate the following error:
"[Microsoft][ODBC Microsoft Access Driver] The specified field '[RepLeaderID]' could refer to more than one table listed in the FROM clause of your SQL statement. "
Can somebody tell me why I have this error, and what can I do.
<%
Option Explicit
Dim strConnect
%>
<!-- METADATA TYPE = "typelib" FILE = "C:\Program Files\Common Files\System\ado\msado15.dll" -->
<html>
<head>
<title> Query the database </title>
</head>
<body>
<%
Dim objRS, objComm, objParam, strRepLeader
Dim adCmdStoredProc
adCmdStoredProc = 4
Set objComm = Server.CreateObject("ADODB.Command"
strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/db/report.mdb"&";" &_
"Persist Security Info = False"
objComm.ActiveConnection = strConnect
objComm.CommandText = "qryRep"
objComm.CommandType = adCmdStoredProc
Set objParam = objComm.CreateParameter("tblRepLeader.RepLeaderID", adVarChar, adParamInput, 10)
objComm.Parameters.Append objParam
strRepLeader = "VLN"
objComm.Parameters("tblRepLeader.RepLeaderID" = strRepLeader
Set objRS = objComm.Execute
Set objComm = Nothing
Set objParam = Nothing
objRS.MoveFirst
Response.write objRS("RepLeaderID" & ", and Category is " & objRS("Category" & "<BR>"
objRS.Close
Set objRS = Nothing
%>
</BODY>
</HTML>
Here is the situation: I used 3 tables for qryRep, which is the stored procedure for the following ASP page. However, when I run it, I generate the following error:
"[Microsoft][ODBC Microsoft Access Driver] The specified field '[RepLeaderID]' could refer to more than one table listed in the FROM clause of your SQL statement. "
Can somebody tell me why I have this error, and what can I do.
<%
Option Explicit
Dim strConnect
%>
<!-- METADATA TYPE = "typelib" FILE = "C:\Program Files\Common Files\System\ado\msado15.dll" -->
<html>
<head>
<title> Query the database </title>
</head>
<body>
<%
Dim objRS, objComm, objParam, strRepLeader
Dim adCmdStoredProc
adCmdStoredProc = 4
Set objComm = Server.CreateObject("ADODB.Command"
strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/db/report.mdb"&";" &_
"Persist Security Info = False"
objComm.ActiveConnection = strConnect
objComm.CommandText = "qryRep"
objComm.CommandType = adCmdStoredProc
Set objParam = objComm.CreateParameter("tblRepLeader.RepLeaderID", adVarChar, adParamInput, 10)
objComm.Parameters.Append objParam
strRepLeader = "VLN"
objComm.Parameters("tblRepLeader.RepLeaderID" = strRepLeader
Set objRS = objComm.Execute
Set objComm = Nothing
Set objParam = Nothing
objRS.MoveFirst
Response.write objRS("RepLeaderID" & ", and Category is " & objRS("Category" & "<BR>"
objRS.Close
Set objRS = Nothing
%>
</BODY>
</HTML>