Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL update with different database
Message
De
02/11/1998 15:35:58
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Titre:
SQL update with different database
Divers
Thread ID:
00153692
Message ID:
00153692
Vues:
50
HI !

I have a problem with VFP 5.0 and SQL Server 6.5.
I want to update 2 tables that are in a different database in SQL Server.

code with the problem
=================
1- I use the command "SQLConfigDataSource" to create a datasource for my server. The database is the database by default. (Database_1)
2- I create one connection to SQL with the command "SQLCONNECT" for my tables.
3- I make each cursor updatable.

When I update the table that is in the default database (Database_1) of the DataSource everything works fine.
But, for the other table (in Database_2) I receive the error : [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'MySecondTable'.

code to resolve the problem
=====================
1- I create 2 DataSources. (One for each Database in Sql Server).
2- I create 2 connections. (One for each Table).
When I update the data, my code just works fine.

Did someone know a better way to update tables in different database.
Can I use only one DataSource ?

Thanks in advance ! :o)

Steph
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform