Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySql remove view

Status
Not open for further replies.

FoxAll

Programmer
Jun 13, 2003
49
CA
Hi,

I created an ODBC connection to a remote MySql database.
I modify my database container to include a new remote view.
This work perfectly, I can browse the data.

When I try to select a table with a name that contain space in it. It give me a Error.

Same error if I try to select fields with a space in it.
Everiting with space like :"DB sample data" do not work.?

see error message:
"The Remote View Wizard was unable to obtain column information for this remote table. This may the result of an ODBC error, or the remote table may not owned by the current user, or the table doesn't have columns"

When I take a working query then add another field with space in the name, it give me error, so I look to the SQL source :

DBSetProp(ThisView+".prix_de_la_recharge","Field","DataType","B(2)")
DBSetProp(ThisView+".prix_de_la_recharge","Field","UpdateName","sauvegardenov08."+CHR(34)+"Prix de la recharge"+CHR(34))
DBSetProp(ThisView+".prix_de_la_recharge","Field","KeyField",.F.)
DBSetProp(ThisView+".prix_de_la_recharge","Field","Updatable",.T.)

Is it a wizard error or ODBC error? How can I work around?
Thanks for your help






 
Hi FoxAll,

In MySQL, you use a "backtick" as a delimiter for column and table names that contain embedded spaces. A backtick is the same un accent grave, that is, CHR(96).

I'm not sure if you can use these in the remote view wizard (which I've never used). However, it might be possible to create the remote view programmatically. Something like this:

CREATE SQL VIEW MyView REMOTE CONNECTION MyConnection ;
AS SELECT `prix de la recharge`, ..... <etc>

You might need to experiment a bit with the syntax.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top