Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC connection
Message
From
22/11/2007 11:21:41
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
22/11/2007 11:06:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
MySQL
Miscellaneous
Thread ID:
01270657
Message ID:
01270722
Views:
28
>Hi Dragan,
>
>It seems like my poor command over english is creating more problems than resolving the issues. I am therefore writing the whole code again (and this time full query) to save us both from anymore confusions.
>
>lha = SQLSTRINGCONNECT("driver=MySQL ODBC 3.51 Driver;server=192.168.2.2;uid=root;pwd=ctmroot;database=yesloans",.T.)
>
>lcQry = "Select u.userid Id, concat(u.firstname, ' ', u.lastname) Name, count(*) No_Of_App from yesloans.loans as l " + ;
> "join yesloans.users as u " + ;
> "on l.takenby = u.userid " + ;
> "join yesloans.customers as c " + ;
> "on c.customerId = l.customerId " + ;
> "where date(dateapplied)=date(now()) " + ;
> "and statuscomplete='Y' " + ;
> "and statusassessed='Y' " + ;
> "and statusapproved='Y' " + ;
> "and c.homeTypeId <> 5 " + ;
> "and statuscancelled='N' " + ;
> "and hour(timeapplied) = " + ALLTRIM(STR(ThisForm.txtHr.Value)) + ;
> " group by l.takenby"
>
>lnRes = SQLEXEC(lha, lcQry, 'cmpData')
>
>I have attached the code suggested by you immediately after "lnRes = SQLEXEC(lha, lcQry, 'cmpData')" and found the message that "Table yesloans.loans doesn't exist". Now this is confusing to me because if I change the sql connection
>
>lha = SQLSTRINGCONNECT("driver=MySQL ODBC 3.51 Driver;server=192.168.2.2;uid=root;pwd=ctmroot;database=yesloans",.T.)
>
>with
>
>lha = sqlconnect('mySQLODBC')
>
>the whole thing is working even though the length of lcQry is 411.

So it's something in the connectstring. When you connect using the latter method, what is the result of

?sqlgetprop(lha, "ConnectString")

Compare that with your connect string. See also message #1270598 - the same thing, a bit longer.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform