Bonjour je souhaite recopier une base de donné d'un fichier txt vers une table access donc j'utilise un fichier Shema.ini pour lui donné le format de ma table
le programme marche tres bien si j'utilise comme d'elimiteur un ";"
pour tabulation ca ne marche pas, il format pas comme il faut
Shema.ini
[waypoints.txt]
Format=TabDelimited
CharacterSet=ANSI
Col1=IfProv Char Width 20
Col2=License Char Width 20
//waypoints.txt
North West
N4438.223 W6335.468
N4438.225 W6335.335
N4438.147 W6335.577
N44 38.150 W6335.585
//mon code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #If SGBD = "Access" Then Dim command As New OleDb.OleDbCommand Dim reader As OleDb.OleDbDataReader #ElseIf SGBD = "SQL" Then Dim command As New SqlClient.SqlCommand Dim reader As SqlClient.SqlDataReader #End If FctBase.Connection_BDMvts() command.Connection = Depart.ConnectionBdMvtsNet command.CommandText = "INSERT INTO EMPFLER SELECT * FROM [Text;;;DATABASE=D:\essai;].[waypoints.txt];" command.ExecuteNonQuery() command.Dispose()donc il prend pas en consideration la tabulationlors de l'execusion du command.ExecuteNonQuery() il me dit:
L'instruction INSERT INTO contient le nom de champ inconnu suivant : 'North_West'. Assurez-vous que vous avez correctement saisi le nom, puis recommencez l'opération.




Répondre avec citation

Partager