|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Expected end of statement error
Hi
I searched for the above error, and I browsed to the answers available here and elsewhere. I tried those things and it didn't work. So I am posting here the code. The code which worked previously was this (line breaks for readability): Code:
<%
var rsmidtown = Server.CreateObject("ADODB.Recordset");
rsmidtown.ActiveConnection = MM_connmidtown_STRING;
rsmidtown.Source = "SELECT SKU, Description, Unit, ListPrice,
MasterCategoryID, CategoryID, SubCategoryID, UPC FROM tblMasterSKU";
rsmidtown.CursorType = 0;
rsmidtown.CursorLocation = 2;
rsmidtown.LockType = 1;
rsmidtown.Open();
var rsmidtown_numRows = 0;
%>
This was working, then I went into Access, and got another query with multiple tables and fieldnames, with joins. Instead of previous rsmidtown.source I entered this rsmidtown.source statement: Code:
rsmidtown.Source = "SELECT tblMasterSKU.SKU, tblMasterSKU.MasterCategoryID, tblMasterCategoryNames.MasterCategoryName, tblMasterSKU.CategoryID, _ tblCategoryNames.CategoryName, tblMasterSKU.SubCategoryID, tblSubCategoryNames.SubCategoryName, tblSKUProductGroupLinks.ProductGroupID, tblMasterProductGroups.ShortDescription, tblMasterProductGroups.LongDescription, tblMasterProductGroups.MfgrID, tblManufacturer.MfgrName, tblManufacturer.URL FROM (tblSubCategoryNames INNER JOIN (tblMasterCategoryNames INNER JOIN (tblCategoryNames INNER JOIN tblMasterSKU ON tblCategoryNames.CategoryID = tblMasterSKU.CategoryID) ON tblMasterCategoryNames.MasterCategoryID = tblMasterSKU.MasterCategoryID) ON tblSubCategoryNames.SubCategoryID = tblMasterSKU.SubCategoryID) INNER JOIN ((tblManufacturer INNER JOIN tblMasterProductGroups ON tblManufacturer.MfgrID = tblMasterProductGroups.MfgrID) INNER JOIN tblSKUProductGroupLinks ON tblMasterProductGroups.ProductGroupID = _ tblSKUProductGroupLinks.ProductGroupID) ON tblMasterSKU.SKU = tblSKUProductGroupLinks.SKU;"; Now the previous statement is also not working. Can someone help me with this? This is an asp page, in vbscript, for an Access db. thanks |
|
#2
|
||||
|
||||
|
You should do it like this
Code:
strSql = "SELECT tblMasterSKU.SKU, tblMasterSKU.MasterCategoryID, " strSql = strSql & "tblMasterCategoryNames.MasterCategoryName, " etc... rsmidtown.Source = strSql |
|
#3
|
|||
|
|||
|
hi
thanks, it works now. |
|
#4
|
|||
|
|||
|
Hi
It worked probably 2 times, and now it gives me time-out error? Why? thanks |
|
#5
|
||||
|
||||
|
Make sure you are closing and disposing of all of your objects.
Timeout errors are generally caused by high network traffic or locking on the database. |
|
#6
|
|||
|
|||
|
what is locking of the database?
|
|
#7
|
||||
|
||||
|
When updating or deleting records, the database is locked so the records can't be read.
|
|
#8
|
|||
|
|||
|
Hi
I opened and closed the db, and it is OK now. thanks for your help |
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > Expected end of statement error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|