Anita
Nov 18th, 1999, 04:05 AM
I have declared the following in a bas module.
Public cnMainData As Connection
Public rs As Recordset
Then in the form load event I wrote
Set cnMainData = New Connection
Set rs = New Recordset
With cnMainData
.Provider = "Microsoft.Jet.OLEDB.3.51"
.ConnectionString = "c:\Anita\db1.mdb"
.Open
End With
With rs
.Open "Employer", cnMainData, adOpenDynamic
.AddNew
!CompanyName = Text1.Text
!Vocation = Text2.Text
!ContactPerson = Text3.Text
!Address = Text4.Text
!city = Text5.Text
!ZipCode = Text6.Text
!Phoneno = Text7.Text
!FaxNo = Text8.Text
!EmailId = Text9.Text
!PreviousPlacements = Text10.Text
.Update
End With
It is giving a run-time error 3251
for rs.addnew.
" The operation required by the application is not supported by the provider.
If I declare
Public cnMainData As ADODB.Connection
Public rs As ADODB.Recordset
it is giving the same result.
Public cnMainData As Connection
Public rs As Recordset
Then in the form load event I wrote
Set cnMainData = New Connection
Set rs = New Recordset
With cnMainData
.Provider = "Microsoft.Jet.OLEDB.3.51"
.ConnectionString = "c:\Anita\db1.mdb"
.Open
End With
With rs
.Open "Employer", cnMainData, adOpenDynamic
.AddNew
!CompanyName = Text1.Text
!Vocation = Text2.Text
!ContactPerson = Text3.Text
!Address = Text4.Text
!city = Text5.Text
!ZipCode = Text6.Text
!Phoneno = Text7.Text
!FaxNo = Text8.Text
!EmailId = Text9.Text
!PreviousPlacements = Text10.Text
.Update
End With
It is giving a run-time error 3251
for rs.addnew.
" The operation required by the application is not supported by the provider.
If I declare
Public cnMainData As ADODB.Connection
Public rs As ADODB.Recordset
it is giving the same result.