Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Write String with Comma doesn't work
Message
 
À
22/06/2000 21:21:18
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00383549
Message ID:
00384263
Vues:
30
>Anyone could help? I encountered "Error occurred" message when
>trying to write a String of data with Comma in it into a table.
>I recorded the error description as "Microsoft Cursor Engine".

This is really curious. I just tried your code with the NWIND database, and it is working!!! Try it too!

This error may have relation to your field definition. Are you sure that your field is long enough?
Option Explicit

Private cnn1 As ADODB.Connection
Private rsCust As ADODB.Recordset

Private Sub Command1_Click()
    rsCust.Open "Select * from employees", cnn1, adOpenKeyset, adLockOptimistic
    Set DataGrid1.DataSource = rsCust
    DataGrid1.Refresh
End Sub

Private Sub Command2_Click()
    With rsCust
        .AddNew
        !LastName = "Moreau"
        !FirstName = "Eric"
        !Title = "Analyst, programmer"
    End With
End Sub

Private Sub Form_Load()
    Set cnn1 = New ADODB.Connection
    Set rsCust = New ADODB.Recordset
    
    cnn1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Projets VB\NWIND.mdb;Persist Security Info=False;"
    cnn1.CursorLocation = adUseClient
    cnn1.Open
End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform