Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Code to MySQL
Message
 
To
03/10/2006 15:35:00
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01158996
Message ID:
01159138
Views:
24
>>
>
>
>>//ALLTRIM(dst.ccity)+", "+ALLTRIM(dst.cstate) as dest_city, ;
>>concat(TRIM(dst.ccity), ", ",TRIM(dst.cstate) as dest_city,  <-- missing parenthesis here

Okie doke. Will fix. Thanks, Dragan.
>>//LEFT JOIN c_d!users ue ON ue.uid = x.eby ;
>>LEFT JOIN users ue ON ue.uid = x.eby
>>
>>//WHERE cmp.cname like lcCname ;
>>WHERE cmp.cname like lcCname   ***** NOTE: this is a local variable in VFP! *****
>// so you'd need to insert a '<<lcCname>>' here in textmerge to get the right
>// value in the command. Same goes for other VFP variables.

Right on, bro :^).

>>//AND TTOD(rdt) >= ldDateLow ;
>>
>>//AND TTOD(rdt) <= ldDateHigh ;
>
>// instead ot ttod you'd simply have to have '<<ldDateLow>>' compared with the
>// rdt field, probably with a ... and rdt between '...' and '...'

I was wondering about that, Dragan; however, in the DatePicker
code where he's setting this particular criteria, he's using TTOD on
a DateTime() return value, striping out the timestamp, even though
the actual comparison in the above code is a datetime field in the record.
(Shrug.)

>>//AND DELETED() = .F. ;
>
>// there are no deleted records. this line goes away.
>
>>//AND x.acc = lcAccID ;
>>
>>//INTO CURSOR curDnumList READWRITE
>>
>>[NOTE: Decided to stop here when I saw the "INTO CURSOR" code. Hold all horses! :^)]
>>
>
>The "into cursor" part is unnecessary, unless you want to use it for another select
>while you're connected.

As you've probably guessed, I'm more than likely just going to do this:

mysql_connect();

mysql_exec(The Select Statement);

mysql_close();

and then get the heck out of Dodge :^). That is, reports aren't printed very
often, so no need to stay connected to the databases.

Basically, here's the pseudo code:
lcCompany = SelectCompany(user selected company);
lcStartDate = DatePicker(StartDate);
lcEndDate = DatePicker(EndDate);
CompanyRecords = QueryMySQL(lcStartDate,lcEndDate,lcCompany);
error = PrintReport(CompanyRecords);

IF (error)
 die(Get the heck out and tell user about it);
ELSE
  return (to main page as a happy camper);
>There should be something telling MySQL to direct the result set into a temporary table.

Yeah. I need to find out how to do this on the MySQL site or in one of my books.
Basically, I'm trying to hack code in VFP and MySQL, fixing on-demand problems in
a biz that works 24/7/365, with all of our clients working 24/7/365. One day its,
"Randall, fix this...no. wait. Fix that. Stop one sec on that project, and start
writing this one. Okay. Kewl. Here's a bonus, now we really need this project started,
so work late tonight and get this done by morning. Thanks!" etc. :^) :^)

>I know I saw it somewhere, but I probably have just two days more experience with MySql
>than you have, so... look it up.

LOL! Okay. I'll look it up on the MySQL site. I was hoping that a VFP developer who
also does MySQL was hanging around and that he/she would point me in the right
direction. Oh, well. Back to the books!

Randall
--
Randall Jouett
Amateur/Ham Radio: AB5NI
I eat spaghetti code out of a bit bucket while sitting at a hash table! Someone
asked me if I needed salt, and I said, "I'm not into encryption." :^)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform