Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to split your insert statement ,you have to use the "insert into..." every time that you want to insert something in the Address but also if you want to to execute it just once in VB you need to separate each statement with the <strong>semicolon</strong> (;), it should work</p> <p>You need to do something like this. </p> <pre><code>Insert Into Agencies (Address) Values (" 1330 W Indian School Rd, "); Insert Into Agencies (Address) Values (" 3323 E Baseline Rd, "); Insert Into Agencies (Address) Values (" 207 N Gilbert Rd, "); Insert Into Agencies (Address) Values (" 3160 S. Gilbert Rd., Ste. 4, "); </code></pre> <p><strong>Edit</strong></p> <p>your while should be </p> <pre><code>While MatchObj.Success sql = " Insert Into Agencies (Address) Values" sql = sql &amp; "(""" &amp; MatchObj.Groups(1).Value &amp; """); " MatchObj = MatchObj.NextMatch() End While </code></pre> <p>Although I strongly recommend to insert each one in separate statements and in a transaction, but it depends to you.</p> <hr /> <p><strong>Edit 2</strong></p> <p>You can't insert multiple records at the same time in MS- Access you must do it insert per insert like...</p> <pre><code>Public Sub executeSQL(ByVal sql As String) Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='C:\Local Projects\AgenciesAZ.mdb'" Dim conn As OleDbConnection = New OleDbConnection(connString) Dim cmd As OleDbCommand = New OleDbCommand(sql, conn) conn.Open() cmd.ExecuteNonQuery() conn.Close() End Sub While MatchObj.Success sql = " Insert Into Agencies (Address) Values" sql = sql &amp; "(""" &amp; MatchObj.Groups(1).Value &amp; """); " executeSQL(sql ) MatchObj = MatchObj.NextMatch() End While </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload