Wrox Programmer Forums
|
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 30th, 2006, 04:16 PM
Registered User
 
Join Date: Oct 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to love_spy74
Default Access problem ªª

Hi...im receive the next message when i was running a program...I acces to SQL with VB

ERROR '-2147217900(80040e14)
The number name 'quantitydbo.BCSMF_SalesPerson.agentfirstnamedbo.B CSM_SPERSON> contain more than the maximum number of prefixes. the maximum is 3

the code is next

rsorders.Open "select BCSMF_Orders.orderdate,BCSMF_Orders.orderid,dbo.BC SMF_Ordersdetails.productID" & _
    "productprice,quantity" & _
    "dbo.BCSMF_SalesPerson.agentfirstname" & _
    "dbo.BCSMF_SPersonxSCenter.ScenterID" & _
    "dbo.BCSMF_SupplyingCenter.ScenterName" & _
    "dbo.BCSMF_SupplyingCenter.CityID" & _
    "dbo.BCSMF_City.CityName" & _
    "dbo.BCSMF_Customers.StateID" & _
    "dbo.BCSMF_state.StateName" & _
"From dbo.BCSMF_Orders" & _
    "dbo.BCSMF_OrdersDetails" & _
    "dbo.BCSMF_SalesPerson" & _
    "dbo.BCSMF_SPersonxSCenter" & _
    "dbo.BCSMF_SupplyingCenter" & _
    "dbo.BCSMF_City" & _
"where signname is null " & _
       "and orderdate BETWEEN #" & Format(CldInicial.Value, "MM/DD/YYYY") & "#" & _
       "and #" & Format(CldFinal.Value, "MM/DD/YYYY") & "#" & _
       "and dbo.BCSMF_Orders.orderid=dbo.BCSMF_Ordersdetails.o rderid" & _
       "and dbo.BCSMF_SalesPerson.SPersonID=dbo.BCSMF_Orders.S PersonID" & _
       "and dbo.BCSMF_Orders.SPersonID=dbo.BCSMF_SPersonxSCent er.SPersonID" & _
       "and dbo.BCSMF_SPersonxSCenter.ScenterID = dbo.BCSMF_SupplyingCenter.ScentrID" & _
       "and dbo.BCSMF_SupplyingCenter.CityID= dbo.BCSMF_City.CityID" & _
"order by orderdate", MASTER, adOpenDynamic, adLockOptimistic, adCmdText
:(

 
Old October 30th, 2006, 04:46 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there.. you forgot all the "," between the names of the fields ;)

Code:
   "dbo.BCSMF_SalesPerson.agentfirstname, " & _
    "dbo.BCSMF_SPersonxSCenter.ScenterID, " & _
    "dbo.BCSMF_SupplyingCenter.ScenterName, "
and so on...

HTH

Gonzalo
 
Old October 30th, 2006, 05:59 PM
Registered User
 
Join Date: Oct 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to love_spy74
Default

Sorry this isnt te solution....

 
Old October 31st, 2006, 09:24 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

ok.. this is the solution, but not the only problem..

you have problems with spaces inside the string, for example:

Code:
"and dbo.BCSMF_Orders.orderid=dbo.BCSMF_Ordersdetails.orderid" & _
       "and dbo.BCSMF_SalesPerson.SPersonID=dbo.BCSMF_Orders.SPersonID" & _
this line with produce this string:

and dbo.BCSMF_Orders.orderid=dbo.BCSMF_Ordersdetails.o rderidand dbo.BCSMF_SalesPerson.SPersonID=dbo.BCSMF_Orders.S PersonID

look that is has a space missing betwenn orderid and the word "and"... the & will not add any space nor , nor anything to the string, it will just paste one string to the other.

you have also missing "," in the form clause, the from, where and order are not separated by space from they previous line, and I'm not sure about this, but i think you cannot use the "is null" in the where, you have to use isnull function (but not sure about this)....

so separate each field with ,
leave spaces between each name of field...

HTH

Gonzalo





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with access emt_101 Access VBA 0 May 5th, 2008 12:21 PM
Access Problem dozzen Access VBA 12 March 2nd, 2007 07:51 AM
Access problem love_spy74 Pro VB Databases 3 November 8th, 2006 02:32 PM
Access problem edWAR PHP How-To 2 July 13th, 2004 01:21 PM
Data access page access problem :) kev_79 Access 0 September 4th, 2003 04:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.