I don't really see anything wrong with the code you are using. Below is a more complete example: Dim SourceFile As String = "report.csv" Dim DestinationFile As String = "report1.csv" ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ Dim TextConnection As New System.Data.OleDb.OleDbConnection(ConnectionString) TextConnection.Open() Dim SQLString As String = "SELECT * INTO " & DestinationFile & " FROM " & SourceFile Dim TextConnection As New System.Data.OleDb.OleDbCommand(SQLString, TextConnection) TextConnection.ExecuteNonQuery() TextConnection.Close()
"Data Source=" & "E:\My Documents\TextFiles" & ";" & _
"Extended Properties=""Text;HDR=YES;"""
oleDbCmd.CommandText = "INSERT INTO x ( column1, column2 ) VALUES ( ?, ? )";
oleDbCmd.Parameters.Add("@value1", OleDbType.Int32).Value = 10;
oleDbCmd.Parameters.Add("@value2", OleDbType.String).Value = "O'Reilly";
my query "SELECT * INTO " & DesstinationFile & " FROM " & SourceFile &" is in a class, but I want to softcode the file desinationFile and SourceFile in another module. How would I do that?