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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vfp7 and searching tables in sql2000 1

Status
Not open for further replies.

fluppeke

Programmer
Aug 30, 2006
38
BE
Hi You experts,

I have a program made with vfp7.
Now I would like to know if a table exists under sql 2000 and if the table exist, I would like to know if all ingredients are present.

for example : table rates
if the table rates exists I would like to know if zone end_year exists. if it doesn't I either want to create the table or alter the table.

Creating a table is not the problem, altering the table also
not a problem

the problem is simple how to find the information

any help very usefull

Fïlip Merlier

 
Hi Filip,

Would SQLTABLES() do what you want?

Code:
lnConn = SQLCONNECT("MyDataSource")
lnReply = SQLTABLES(lnConn, "TABLE", "TableCursor")
IF lnReply > 0
  SELECT TableCursor
  LIST
ENDIF

That should give you a list of all the tables referenced from the data source.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Hi Mike ,

That is the first thin I want.
The second thing is looking in the table and see if all the zones I want to have in are present
If they are not, I can alter table.

wfg,

Filip Merlier
 
Hi Mike,

Thanks for your help... I give you a star for it

Filip
 
hello Mike,


I tried the first option so slqtables, but he answers me always alias tablecursor is not found
the value of lnreply is 1

Any help please ??

FILIP
 
hello Mike

First A happy new year.
I found my error, I changed tablecursor with blabla and then I could browse the blabla cursor.

Thanks anyway for being so concurred with my problem

Filip Merlier
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top