Results 1 to 9 of 9

Thread: SELECT * Not Working For Access Database

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2008
    Posts
    84

    Angry SELECT * Not Working For Access Database

    for the first time i am havin this kind of issue, i tried some google'in but of none help.

    Code:
        Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Log("Application Started Successfully")
    
            Log("Attempting To Connect To Database", True)
    
            If dbConnect(Application.StartupPath & "\myDatabase.mdb") Then
                Log("Successfully Connected To Database", True)
            Else
                MessageBox.Show("Unable To Connect To Database Critical Error", APP_NAME, MessageBoxButtons.OK, MessageBoxIcon.Error)
                Application.Exit()
            End If
    
            'Using cmd As New OleDb.OleDbCommand("INSERT INTO MY_SETTING VALUES(1, 'TEST', 'TEST')", Conn)
            '    Debug.Print("Record's Affected : " & cmd.ExecuteNonQuery())
            'End Using
    
            Using cmd As New OleDbCommand("SELECT * from MY_SETTING;", Conn)
                Debug.Print("Total ID : " & cmd.ExecuteNonQuery())
            End Using
    
        End Sub



    The weird problem is INSERT is working but Select is not working!
    Last edited by -RaJ-; Aug 29th, 2011 at 03:59 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width