sql strings a better way?

Moderator: Rathinagiri

Post Reply
User avatar
metron9
Posts: 45
Joined: Sat Sep 08, 2012 7:18 am
Location: Minnesota U.S.A.

sql strings a better way?

Post by metron9 » Mon Oct 15, 2012 6:57 am

Is making the string qstring in this function to call the sql function the only way to do this or is there a better way?

oh, and is there a timeout on an open mysql data table, do I want to open it and close it with destroy any time I access the table?

function searchmysql(parm1)
oDB:=connect2db()
parm1='92523257'
qstring:='select * from partbase where partno = "' + parm1 + '"'

msgbox(qstring)

aTable := sql( oDB, qstring)
cRecord := ''
for i := 1 to 1 // len( aTable )
cRecord:=alltrim('www.ccspecialorders.com/pictures/'+aTable[i,8])
showpicture(cRecord)
order_parts.info_text.Value := str(aTable[1])
next i
oDB:Destroy()
return nil

User avatar
Rathinagiri
Posts: 5181
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 141 times
Been thanked: 131 times
Contact:

Post by Rathinagiri » Mon Oct 15, 2012 9:24 am

I think once connected, the connection will be retained for further queries. So, you need not connect and close every time you access.

I checked this with my own website hosted. However, I don't know about open mysql table.

Regarding the sql string, I have a function c2sql() for parsing. It is just like your application only.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

Post Reply