Source language: Translate to:

Show table with word reserved

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Show table with word reserved

Postby Fabien » Thu Jul 21, 2011 3:07 am

Hi all,

I know that this configuration is bad but I have no choice.

The table name is: USER (It's word reserved!).

How can I do "dbpOpenTable" without error ?

On utility SQL I use hooks for word reserved, example: SELECT * FROM [USER];
It's Ok.
On Neobook: [#91]USER[#93]: not ok.

Do you have a solution for NeoBook?

Fabien,
¡ sǝıʇɹo sǝl suɐp éɯéɯ sɐd ǝssnod
User avatar
Fabien
 
Posts: 137
Joined: Thu Dec 04, 2008 2:31 pm
Location: France - Lyon

Postby smartmedia » Thu Jul 21, 2011 4:31 am

Hi..

Try that.
SELECT * FROM USER as UserTable;

and tell me..
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Fabien » Thu Jul 21, 2011 6:06 am

Thank for reply,

but problem....

Error message : Cannot perfom this operation on a closed dataset

Fabien
¡ sǝıʇɹo sǝl suɐp éɯéɯ sɐd ǝssnod
User avatar
Fabien
 
Posts: 137
Joined: Thu Dec 04, 2008 2:31 pm
Location: France - Lyon

Postby smartmedia » Thu Jul 21, 2011 6:18 am

Hi..

Post a demo pub with the database in order to check out..
User avatar
smartmedia
 
Posts: 889
Joined: Fri Apr 01, 2005 6:50 am
Location: Hellas

Postby Fabien » Thu Jul 21, 2011 2:59 pm

I'm sorry it's not possible to post a database.

The database is Server HyperFile SQL.
Between my pub and database, I use driver ODBC HF.
For connexion with dbpOpenDatabase is OK
For other table with dbpOpenTable is OK but not table "USER" because it's word reserved.
¡ sǝıʇɹo sǝl suɐp éɯéɯ sɐd ǝssnod
User avatar
Fabien
 
Posts: 137
Joined: Thu Dec 04, 2008 2:31 pm
Location: France - Lyon

Postby Wrangler » Fri Jul 22, 2011 8:12 am

Don't know if this will work, but try making a dump of the database, open it up and rename the table 'user' using search and replace. Then send the DB back wherever it was. Then it should work in Neobook.

As long as the table is named 'user', you won't be able to open it using ODBC.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1505
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby Gaev » Fri Jul 22, 2011 9:37 am

Fabien:

I can't be sure if this will work (becuase I don't have a database with a table whose name is User) ... but continuing on from smarmedia's suggestion, I found this to work ...
Code: Select all
dbpOpenAccessDatabase "Fabien1" "C:\gk\Neo5\gkLab\AddressBook.mdb" ""
dbpExecSQL "Fabien1" "SELECT * FROM States" "UserTable"
dbpShowGrid "Fabien1" "UserTable" "UserRectangle"


So you might try something similar ...

a) replacing dbpOpenAccessDatabase with your dbpOpenDatabase command

b) replacing States with User
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Fabien » Sat Jul 23, 2011 10:06 am

Wrangler, thk, the database works with other software and I am not the creator of it, but it's impossible to rename the table the risk of corrupting the operation.

Gaev, I will test as soon as possible and I will give answers.

Fabien
¡ sǝıʇɹo sǝl suɐp éɯéɯ sɐd ǝssnod
User avatar
Fabien
 
Posts: 137
Joined: Thu Dec 04, 2008 2:31 pm
Location: France - Lyon

Postby Fabien » Wed Jul 27, 2011 3:14 pm

Hi all,

I tried your suggestions and still the same message:
Error message : Cannot perfom this operation on a closed dataset

Fabien[/b]
¡ sǝıʇɹo sǝl suɐp éɯéɯ sɐd ǝssnod
User avatar
Fabien
 
Posts: 137
Joined: Thu Dec 04, 2008 2:31 pm
Location: France - Lyon

Postby Neosoft Support » Thu Jul 28, 2011 10:10 am

First of all, you should never use a reserved word as a table name. There will always be situations were this will cause problems.

However, I assume that you have tried:

dbpOpenTable "DB" "[#91]USER[#93]" ""

and

dbpExecSQL "DB" "SELECT * FROM [#91]USER[#93]" ""

and

dbpCreateView "DB" "[#91]USER[#93]" "ViewOfUsers"

Other than that I'm not sure what to suggest.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby Fabien » Fri Jul 29, 2011 2:44 am

Hi,

I know that it is better to avoid reserved words, which seems logical, but as I am not the author of the base ...

Actually have different code were tested without success.
I tested with different SQL engine, and then the SQL "SELECT * FROM [USER]" works great. Obviously if we use the brackets.
With the plugin NeobookDBPro impossible.
Too bad there is no alternative.

I will try in this case, if I have time to make a plug to connect the table.

Thank you all.
Fabien
¡ sǝıʇɹo sǝl suɐp éɯéɯ sɐd ǝssnod
User avatar
Fabien
 
Posts: 137
Joined: Thu Dec 04, 2008 2:31 pm
Location: France - Lyon


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 2 guests