Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Microsoft Access and VB .Net

Microsoft Access and VB .Net

Scheduled Pinned Locked Moved Visual Basic
csharpdata-structuressecurityregexhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zulfikar Ali
    wrote on last edited by
    #1

    Any has any idea ahy this is crashing on me giving error in the exception "Syntex error in inser into statement" Thank you The code it: Try Dim objCon As OleDbConnection objCon = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source =C:\Projects\PDFMerge_Ali\PDF_Merger\pdMerge.mdb;;Persist Security Info=False") objCon.Open() 'Create an instant of the Adapter Dim daQueue As New OleDbDataAdapter("Select * From Queue", objCon) daQueue.MissingSchemaAction = MissingSchemaAction.AddWithKey Dim dsPubs As New DataSet("Pubs") daQueue.Fill(dsPubs, "Queue") MsgBox("data loaded") ' Create a new instance of a DataTable. Dim tblQueue As DataTable tblQueue = dsPubs.Tables("Queue") Dim drCurrent As DataRow ' Obtain a new DataRow object from the DataTable. drCurrent = tblQueue.NewRow() ' Set the DataRow field values as necessary. drCurrent("ProfileName") = "test" drCurrent("ProfileDes") = "test" drCurrent("FileType") = "test" drCurrent("Merge") = "yes" drCurrent("Match") = "test" drCurrent("Printer") = "test" drCurrent("StartOnLoad") = "yes" drCurrent("PrintFiles") = "test" drCurrent("IncomingDir") = "test" drCurrent("MergeDir") = "test" drCurrent("TemDir") = "test" drCurrent("PrintDir") = "test" drCurrent("FailDir") = "test" 'Pass that new object into the Add method of the DataTable.Rows collection. tblQueue.Rows.Add(drCurrent) MsgBox("Add was successful.") Dim objCommandBuilder As New OleDbCommandBuilder(daQueue) daQueue.Update(dsPubs, "Queue") objCon.Close() MsgBox("Data Updated") Catch ex As Exception MessageBox.Show(ex.ToString) End Try:omg: Zulfikar Ali

    V 1 Reply Last reply
    0
    • Z Zulfikar Ali

      Any has any idea ahy this is crashing on me giving error in the exception "Syntex error in inser into statement" Thank you The code it: Try Dim objCon As OleDbConnection objCon = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source =C:\Projects\PDFMerge_Ali\PDF_Merger\pdMerge.mdb;;Persist Security Info=False") objCon.Open() 'Create an instant of the Adapter Dim daQueue As New OleDbDataAdapter("Select * From Queue", objCon) daQueue.MissingSchemaAction = MissingSchemaAction.AddWithKey Dim dsPubs As New DataSet("Pubs") daQueue.Fill(dsPubs, "Queue") MsgBox("data loaded") ' Create a new instance of a DataTable. Dim tblQueue As DataTable tblQueue = dsPubs.Tables("Queue") Dim drCurrent As DataRow ' Obtain a new DataRow object from the DataTable. drCurrent = tblQueue.NewRow() ' Set the DataRow field values as necessary. drCurrent("ProfileName") = "test" drCurrent("ProfileDes") = "test" drCurrent("FileType") = "test" drCurrent("Merge") = "yes" drCurrent("Match") = "test" drCurrent("Printer") = "test" drCurrent("StartOnLoad") = "yes" drCurrent("PrintFiles") = "test" drCurrent("IncomingDir") = "test" drCurrent("MergeDir") = "test" drCurrent("TemDir") = "test" drCurrent("PrintDir") = "test" drCurrent("FailDir") = "test" 'Pass that new object into the Add method of the DataTable.Rows collection. tblQueue.Rows.Add(drCurrent) MsgBox("Add was successful.") Dim objCommandBuilder As New OleDbCommandBuilder(daQueue) daQueue.Update(dsPubs, "Queue") objCon.Close() MsgBox("Data Updated") Catch ex As Exception MessageBox.Show(ex.ToString) End Try:omg: Zulfikar Ali

      V Offline
      V Offline
      Vipul Bhatt
      wrote on last edited by
      #2

      Kindly check datatypes and data & also if the length of the data does not exceed the maximum length. VIPUL BHATT

      Z 1 Reply Last reply
      0
      • V Vipul Bhatt

        Kindly check datatypes and data & also if the length of the data does not exceed the maximum length. VIPUL BHATT

        Z Offline
        Z Offline
        Zulfikar Ali
        wrote on last edited by
        #3

        Thank you for your response. I had one yes/no field and i was passing string into it. Solved the problem and thank you again.:laugh: Zulfikar Ali

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups