Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Database
MS Access
Create a Select statement in 1 db and insert results in another db file using VB .NET
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="mveliz, post: 4758, member: 1957"] Hi, I am currently writing a VB .NET application where I am trying to open 1 database, create a select statement and then post the results into another database file using Microsoft Access database 2002. The code seems to stop executing at the statement "cmdJetDB.ExecuteNonQuery()" I am using the following code: Dim conn1 As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=C:\Sample.mdb") Dim conn2 As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data source=C:\db2.mdb") conn1.Open() conn2.Open() Dim mySelectQuery As String mySelectQuery = "SELECT Sample.LANE_ADDR, Sample.LANE_DT, Sample.LANE_TM, Sample.LANE_SPEED FROM (Sample) WHERE ((Sample.LANE_ADDR) = '164.909' OR (Sample.LANE_ADDR) = '164.909' AND Sample.LANE_DT BETWEEN #4/4/2003# AND #4/5/2003#)" Dim cmdJetDB As New OleDbCommand(mySelectQuery, conn1) cmdJetDB.ExecuteNonQuery() Dim cmdInsert As String cmdInsert = "Insert INTO Table1 (Sample.LANE_ADDR, Sample.LANE_TM,Sample.LANE_SPEED) VALUES ('164.909', '00:12:30' , '30' )" Dim cmdJetDB2 As New OleDbCommand(cmdInsert, conn2) cmdJetDB2.ExecuteNonQuery() conn2.Close() conn1.Close() Question: What is it that I am not doing. I opened both connections, stated my two SQL statements, yet it is still not working. I really need to get this application working. I have spent the past 2 days working on this problem. Please Help......... [/QUOTE]
Insert quotes…
Verification
Post reply
Database
MS Access
Create a Select statement in 1 db and insert results in another db file using VB .NET
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom