Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wrong Table Names
Message
From
01/09/2019 01:24:33
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Wrong Table Names
Miscellaneous
Thread ID:
01670499
Message ID:
01670499
Views:
54
Sir I have these codes
db1='at20'
lcCONN1='Driver={sql server}; server=SERVER\SQLEXPRESS;Dbq='+"db1"+'; Uid=sa; Pwd=123'
lcCONN1 = STRT(lcCONN1,CHR(13),'')
lcCONN1 = STRT(lcCONN1,CHR(10),'')
con1 = SQLstringCONNECT(lcCONN1)
then I use this command
TEXT TO cmdd noshow
select * from u_forms where wstation='SALES'
ENDTEXT

if sqlexec(con1,cmdd)<0
	aerror(laerror)
	messagebox(laerror[1,2])
endif
It says:
---------------------------
Connectivity error: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'u_forms'.
---------------------------

it meas database is connected but table u_forms does not exists.

Table is physically exists as seen in attached image

Now I issue this command to check all tables in database
TEXT TO cmdd noshow
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
ENDTEXT

If SQLExec(con2,cmdd,'abc')<0
	Aerror(laerror)
	Messagebox(laerror[1,2])
	lok=.F.
	Return.F.
ENDIF

SELECT abc
BROWSE
it is showing only these tables

spt_fallback_db
spt_fallback_dev
spt_fallback_usg
spt_monitor
MSreplication_options

The above tables are not part of database=at20

What I am doing wrong?

Why I am not getting actual tables of my database called at20 to run this query
TEXT TO cmdd noshow
select * from u_forms where wstation='SALES'
ENDTEXT
Please help
Next
Reply
Map
View

Click here to load this message in the networking platform