Ref. SqlSrvr: sqlconnect() works, sqltables() will not. Ideas?

Ref. SqlSrvr: sqlconnect() works, sqltables() will not. Ideas?

Post by Bill Blackma » Sun, 15 Mar 1998 04:00:00



Good afternoon!

I'm working on a Visual Foxpro (VFP) program which, given a target FoxPro
table, will create or recreate a new table in SQL Server. Given that I have
literally hundreds of FP tables to migrate over and refresh, whose
structures occasionally change, I had to tackle something like this!

Anyhow, this is SQL Server 6.5, SP4, client is an NT Workstation (4.0,SP3).
VFP 5.0, Visual Studio service packs applied...

?SQLConnect( 'SQLSRV: Adm_DB', 'sa', '<password>' ) returns a >0 connection
handle, indicating success against this system dsn.
?SQLTables( handle, 'TABLES' ) returns 1, indicating completion and success.
Yet, the VFP cursor (defaults to SQLRESULTS) is always empty. Has the
columns it should, it's just always empty.
It does not matter, in SQLTables(), if you pre-create and supply a cursor,
darn thing still fails...

Created a system dsn to pubs (dsn name SQLSRV Pubs), then tested the sql
calls above -- sqltables always returns no tables.
Tested the ADOWorks (Access97) system dsn; sqlconnect() also works, and
sqltables() returns a list of tables.

Any suggestions from any of you will be heartily appreciated.
Bill Blackman

 
 
 

Ref. SqlSrvr: sqlconnect() works, sqltables() will not. Ideas?

Post by Douglas Sumne » Wed, 18 Mar 1998 04:00:00


SQLTables looks in the database that you are logged into.  Do one of two
things:
1) If you are using an SQL User setup to log into SQL, set the default
database in user setup.
2) issue the command = sqlexec(<your connection handle>, "SET DATABASE TO
<DATABASE>")


>Good afternoon!

>I'm working on a Visual Foxpro (VFP) program which, given a target FoxPro
>table, will create or recreate a new table in SQL Server. Given that I have
>literally hundreds of FP tables to migrate over and refresh, whose
>structures occasionally change, I had to tackle something like this!

>Anyhow, this is SQL Server 6.5, SP4, client is an NT Workstation (4.0,SP3).
>VFP 5.0, Visual Studio service packs applied...

>?SQLConnect( 'SQLSRV: Adm_DB', 'sa', '<password>' ) returns a >0 connection
>handle, indicating success against this system dsn.
>?SQLTables( handle, 'TABLES' ) returns 1, indicating completion and
success.
>Yet, the VFP cursor (defaults to SQLRESULTS) is always empty. Has the
>columns it should, it's just always empty.
>It does not matter, in SQLTables(), if you pre-create and supply a cursor,
>darn thing still fails...

>Created a system dsn to pubs (dsn name SQLSRV Pubs), then tested the sql
>calls above -- sqltables always returns no tables.
>Tested the ADOWorks (Access97) system dsn; sqlconnect() also works, and
>sqltables() returns a list of tables.

>Any suggestions from any of you will be heartily appreciated.
>Bill Blackman


 
 
 

Ref. SqlSrvr: sqlconnect() works, sqltables() will not. Ideas?

Post by Bill Blackma » Sat, 21 Mar 1998 04:00:00


Douglas,

Thanks for your reply and your suggestion.

A major part of my problem turned out to be alot more mundane: in
SqlTables() I was supplying the cursor name that I wanted the results placed
into, as the doc.s say you can. The doc.s do not say that that name MUST be
<= 10 characters long...

Oh, well, so much for my habit of writing code using variable names that are
self-descriptive!

Thanks again.
Bill Blackman

 
 
 

1. VFP sqlconnect() works, sqltables() will not

Good morning!

I'm working on a Visual Foxpro (VFP) program which, given a target FoxPro
table, will create or recreate a new table in SQL Server. Given that I have
literally hundreds of occasionally-changing FP tables to migrate over and
refresh, I had to tackle something like this!

Anyhow, this is SQL Server 6.5, SP4, client is an NT Workstation (4.0,SP3).
VFP 5.0, Visual Studio service packs applied...

?SQLConnect( 'SQLSRV: Adm_DB', 'sa', '<password>' ) returns a >0 connection
handle, indicating success against this system dsn.
?SQLTables( handle, 'TABLES' ) returns 1, indicating completion and success.
Yet, the VFP cursor (defaults to SQLRESULTS) is always empty. Has the
columns it should, it's just always empty.

Created a system dsn to pubs, then tested the sql calls above -- results
exactly the same!!!

Any suggestions from any of you will be heartily appreciated.
Bill Blackman

2. Some Problem of INGRES in OpenVMS

3. SQLSRVR -m (ASE 12) not working

4. How to trap SQL Server error in Form_Error in Access 97?

5. Why this code is not working (REF CURSOR)?

6. Generating serial number column

7. error's ORA 1568 and 600

8. Set Alias Code Not Working - Any Ideas ?

9. Crash recovery is not working, any ideas?

10. SQLtables in VC++: not returning data

11. Willing to work for FREE..... to get experience

12. SQLTables, Driver not capable