Hi
I am using the following code to insert data from a text file into my access database. One of the columns in the database is called "e-mail".
I was getting syntax errors and was forced to rename the column name from e-mail to mail. Doing this seemed to have fixed my problem.
Is there another way of inserting the data into the database without having to rename the e-mail coumn to mail? I want to keep the column name as e-mail. Would appreciate any help / advise.
I am using the following code to insert data from a text file into my access database. One of the columns in the database is called "e-mail".
I was getting syntax errors and was forced to rename the column name from e-mail to mail. Doing this seemed to have fixed my problem.
Is there another way of inserting the data into the database without having to rename the e-mail coumn to mail? I want to keep the column name as e-mail. Would appreciate any help / advise.
VB.NET:
Dim cnn As New ADODB.Connection
Dim Rec As New ADODB.Recordset
Dim sqlString As String
cnn.Open( _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\logs\import\Test.mdb;" & _
"Jet OLEDB:Engine Type=4;")
sqlString = "INSERT INTO [Sheet1] (FirstName, LastName, mail) SELECT FirstName, LastName, mail FROM [Text;DATABASE=C:\logs\import;].[outputfile1.txt]"
cnn.Execute(sqlString)