connecting database without external control,
February 17, 2009 at 6:36 AM
Sir, i create a database in VB by using ADD-INS->VisualDatamanager->File->new->Microsoft Access->version 2.0MDB-> save DB name as "studetails" and tablename as "student".Insert some record name,rollno. After that i click project->reffrences->select microsoft DAO 2.5/3.51 compatibility->click OK.
After that below i write in code window ----------------------------------------
Dim db As Database Dim rs As Recordset Dim cname As String Dim nrno As Integer
Public Sub loaddatabase() db = OpenDatabase(App.Path & "studentdetails.mdb") rs = db.OpenRecordset("student") cname = rs.Fields(0) nrno = rs.Fields(1) End Sub Private Sub Form_Load() loaddatabase Text1.Text = cname Text2.Text = nrno End Sub
when i run a program i get a compile error "Invalid Use of Property" Is the step and code is correct or not? Please mention which step i will follow and clear error.
View All Comments
| View Tutorial