Error in VB code

vb.net , programming , code India
  • 12 years ago
    I am new to Vb programming I am programming a applicatio to connect to database in Access and updating of records. Private Sub addrec_Click() Dim Adodc1 As New ADODB.Recordset Dim Adodc2 As Recordset Dim str As Database Dim str1 As String str1 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _ App.Path & "\Ecmdetail.mdb;Persist Security Info=False" Set str = Adodc1.Open(" select * from ecm ") Adodc2.OpenRecordset (" select * from ecm where ecmserial ='" & [Forms]![Serach]![txtecm] & "';") If Adodc2.EOF Then Adodc2.MoveFirst MsgBox ("No Record Found") Else Adodc2.Edit End If Adodc2!Condition = txtcon Adodc2!Repairedon = txtrepon Adodc2!Issuedto = txtissuto Adodc2!Issuedon = txtissuon Adodc2.Update End Sub When i run the above code i get and a Compiler error :Expected Function or Variable. Could any help me on this. Thanks in Advance Navin

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” - Martin Fowler