-
Using ODBC object
I am trying to pull customer's data from the Acess DB. No luck so far when I am doing specific search. SQL commands are not too hard to understand but the trouble comes when MMF needs to get the right syntax. SQL rules are pretty simple: no quotes around numerical values, single quotes around literal strings, double quotes replace single quotes aroung literal strings (if any). Can someone tell me if this SQL command is correct? It looks OK, MMF "takes" it but nothing is coming from the DB.
"SELECT * FROM CUSTOMERS WHERE (CONTACT_NAME = 'Str$( 'DON')')".
If I do just "SELECT * FROM CUSTOMERS" then I get all the data from the active row. Thanks for help.
-
Using ODBC object
I am trying to pull customer's data from the Acess DB. No luck so far when I am doing specific search. SQL commands are not too hard to understand but the trouble comes when MMF needs to get the right syntax. SQL rules are pretty simple: no quotes around numerical values, single quotes around literal strings, double quotes replace single quotes aroung literal strings (if any). Can someone tell me if this SQL command is correct? It looks OK, MMF "takes" it but nothing is coming from the DB.
"SELECT * FROM CUSTOMERS WHERE (CONTACT_NAME = 'Str$( 'DON')')".
If I do just "SELECT * FROM CUSTOMERS" then I get all the data from the active row. Thanks for help.
-
Re: Using ODBC object
your querry is not valid, because your Str$ part is within ""(don't know how those signs are nammed in english, double quotes?)
here's the correct syntax
"SELECT * FROM CUSTOMERS WHERE (CONTACT_NAME = '"+Str$( 'DON')"+"')"
you should display your querries in text objects to see the result.
-
Re: Using ODBC object
your querry is not valid, because your Str$ part is within ""(don't know how those signs are nammed in english, double quotes?)
here's the correct syntax
"SELECT * FROM CUSTOMERS WHERE (CONTACT_NAME = '"+Str$( 'DON')"+"')"
you should display your querries in text objects to see the result.
-
Re: Using ODBC object
If nothing comming from the DB maybe your access is denied. If you try with "Free", or another free host, SQL is blocked for external users.
-
Re: Using ODBC object
If nothing comming from the DB maybe your access is denied. If you try with "Free", or another free host, SQL is blocked for external users.
-
Re: Using ODBC object
I copied and pasted your command - syntax error. There is a double quote (") after ('DON') I was not sure about, so I deleted it - still syntax error. I also tried similar command strait from the ODBC object example in MMF (replaced column names with mine): "SELECT * FROM CUSTOMERS WHERE CONTACT_NAME = 'DON'" - still no data comes back. And YES, there is a connection between my PC and DB.
AHA!.....I found an issue - "Get Row" suppose to be at the bottom of my command set in the Event List Editor. Now it works!
-
Re: Using ODBC object
I copied and pasted your command - syntax error. There is a double quote (") after ('DON') I was not sure about, so I deleted it - still syntax error. I also tried similar command strait from the ODBC object example in MMF (replaced column names with mine): "SELECT * FROM CUSTOMERS WHERE CONTACT_NAME = 'DON'" - still no data comes back. And YES, there is a connection between my PC and DB.
AHA!.....I found an issue - "Get Row" suppose to be at the bottom of my command set in the Event List Editor. Now it works!
-
Re: Using ODBC object
I indeed made a mistake with the double quote after str$('DON')
Glad you made it work ! <img src="/center/images/graemlins/laugh.gif" alt="" />
-
Re: Using ODBC object
I indeed made a mistake with the double quote after str$('DON')
Glad you made it work ! <img src="/center/images/graemlins/laugh.gif" alt="" />