Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WestWind/database filter help
Message
From
30/06/2011 08:45:55
 
 
To
30/06/2011 03:18:16
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01516279
Message ID:
01516847
Views:
47
Thanks, must have gotten left there from trying to re-work the statement. I threw in some error checking code and get this error when I try to display the data:

"Incorrect syntax near ['SELECT bol_number FROM THESQLTABLE']"

Not sure what's wrong there, do I need to specify the database again instead of just the table?


EDIT: Never mind, I had to change it to this:

cmd = "SELECT *fields* FROM " + THESQLTABLE

Still not working, but I'm going to mess around a bit and reply when I'm sure i can't figure it out. Right now it takes me to a blank page with no headers at all.


>James,
>
>you have one apostrophe to much
>cmd = ['SELECT * FROM THESQLTABLE]+ALLTRIM(user.cclientcd)+[']
>
>>Noted about the parameters, but that's the way everything is set up from before so I'd rather at least get it working that way so I can have something going for me rather than have nothing working and learning a different way to do it.
>>
>> I tried this:
>>
>>
THESQLDB = "TBL_BL"
>>THESQLTABLE = "TBL_BOL"
>>THESERVER = goWCServer.oConfig.oTask.cSQLServer
>>usr = ""
>>pas = ""
>>ConnStr = [driver=SQL Server; server=]+THESERVER+[; database=]+THESQLDB+[; uid=]+usr+[;pwd=]+pas+[; Trusted_Connection=No;]
>>curHandle = SQLstringCONNECT( connStr )
>>cmd = ['SELECT * FROM THESQLTABLE']+ALLTRIM(user.cclientcd)+[']
>>lr = SQLEXEC( curHandle, cmd, "sq") && sq is the cursor the data is loaded into
>>
>>loSC = CREATEOBJECT("wwShowCursor")
>>loSC.lCenterTable = .f.
>>loSC.cHeaderBGColor = "black" &&"#336633"
>>loSC.lAlternateRows = .T.
>>loSC.cAlternatingBGColor = "white" &&"#EFEFEF"
>>loSC.cTableBorder ="3"
>>loSC.cTableWidth="750"
>>DIMENSION laHeaders[10]
>>laHeaders[1] = "BOL"
>>laHeaders[2] = "PRO"
>>laHeaders[3] = "Ref#"
>>laHeaders[4] = "oci"
>>laHeaders[5] = "ost"
>>laHeaders[6] = "ozp"
>>laHeaders[7] = "dci"
>>laHeaders[8] = "dst"
>>laHeaders[9] = "dzp"
>>laHeaders[10] = "Ship Date"
>>loSC.BuildFieldListHeader(@laHeaders)
>>loSC.lSumNumerics = .t.
>>loSC.ShowCursor()
>>lctable=loSC.GetOutput()
>>
>>It stopped asking me which database to use and displays the headers, but it's pulling data from some completely different table than the one I'm trying in my query. I taking out the * and putting in a column name and it did nothing, so apparently I'm still overlooking something big. I have no idea where it's getting the data from.
Previous
Reply
Map
View

Click here to load this message in the networking platform