5 Replies - 218 Views - Last Post: 28 July 2014 - 06:42 PM Rate Topic: -----

#1 pharaon  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 80
  • Joined: 18-October 07

code stop after if statement

Posted 28 July 2014 - 06:16 PM

    Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.LostFocus
        If (objcon.con.State = ConnectionState.Closed) Then objcon.con.Open()
        cmd = New OleDbCommand("INSERT INTO Family_n VALUES('" & TextBox1.Text & "')", objcon.con)
        cmd.ExecuteNonQuery()
        objcon.con.Close()
    End Sub


the code stop after if statement and do not continue why? and how to fix

Is This A Good Question/Topic? 0
  • +

Replies To: code stop after if statement

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9187
  • View blog
  • Posts: 34,489
  • Joined: 12-June 08

Re: code stop after if statement

Posted 28 July 2014 - 06:19 PM

Wrap it in a try/catch and explain the exception.
Was This Post Helpful? 0
  • +
  • -

#3 pharaon  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 80
  • Joined: 18-October 07

Re: code stop after if statement

Posted 28 July 2014 - 06:29 PM

could not find installable isam
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9187
  • View blog
  • Posts: 34,489
  • Joined: 12-June 08

Re: code stop after if statement

Posted 28 July 2014 - 06:32 PM

Have you tried googling the error? Maybe have seen something about how the connection string may be wrong?

http://social.msdn.m...nstallable-isam
Was This Post Helpful? 0
  • +
  • -

#5 Sheepings  Icon User is offline

  • D.I.C Addict

Reputation: 69
  • Posts: 565
  • Joined: 05-December 13

Re: code stop after if statement

Posted 28 July 2014 - 06:36 PM

Can you post your connection info without the password etc. Seems you might be having a driver issue. Try this, it may be helpful to you?
Was This Post Helpful? 0
  • +
  • -

#6 pharaon  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 80
  • Joined: 18-October 07

Re: code stop after if statement

Posted 28 July 2014 - 06:42 PM

Public con As New OleDbConnection("Provider=microsoft.Jet.oledb.4.0; DataSource=" & Application.StartupPath & "\Family_Data.mdb;")

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1