Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I Add records without opening a Recordset?
Message
 
À
28/08/2001 15:57:14
GW Gross
{Banned by Information Security Policy}
Lake Mary, Floride, États-Unis
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00550030
Message ID:
00550048
Vues:
16
This message has been marked as a message which has helped to the initial question of the thread.
Hi,

Do you use VB or MS Access 2000 to run your code?
If you use MS Access 2000 you can simply link your Access 97 table to your Access 2000 database and create Make-Table or Append query to populate new Access 2000 table with the Access 97 data.

HTH, Igor

>I am sure there must be an easier way, but I haven't figured it out yet.
>
>This is what I am doing now:
>
>
>
>'Connect to the database
>set gcnSPOT = New Connection
>
>With gcnSPOT
>
>  .Provider = gdbeJet4
>  .ConnectionString = "Data Source =" & gstrSPOTDB
>  .Open
>
>End With
>
>'Create recordset
>set grsSPOTBatch = New Recordset
>
>'Populate recordset
>gstrSQL = "Select * From Batch"
>
>grsSPOTBatch.Open gstrSQL, gcnSPOT, adOpenKeySet, adLockOptimistic
>
>
>'Create a new record
>grsSPOTBatch.AddNew
>
>'Populate the new record
>
>for mintLoop = 0 to (grsSPOTBatch.Fields.Count-1)
>
>   grsSPOTBatch.Fields.Item(mintLoop).Value = garyDataArray(mintLoop)
>
>next
>
>grsSPOTBatch.Update
>
>
>
>I am basically opening a recordset, that is now getting very large with a Select * command, just so I can put new data in.
>
>This is a MSAccess2000 database.
>
>The garyDataArray is actually a recordset from another database (which is MSAccess97). I am trying to move all of the data from that database to gcnSPOT into identical tables.
>
>I tried an Insert command but had errors on some of the tables because the first field is an "Autonumber" field and I want to keep the orginal number.
>
>Any help would be appreciated.
>
>Thanks,
Igor Gelin
Database Developer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform