PDA

Click to See Complete Forum and Search --> : Cloning a database? Newbie Question


woodyard
Aug 26th, 2000, 02:08 PM
I thought this was the correct way to create a clone of a database. However, I keep getting the message :
"Object variable or With Block not set. "
This is just the way that it is shown in VB Help

Private Sub CmdBackUpDataBase_Click()
Dim rstTemp As Recordset
Set rstNewCopy = rstTemp.Clone

End Sub

I get the same message with

Private Sub CmdBackUpDataBase_Click()
Dim rstTemp As Recordset
Dim rstNewCopy As Recordset
Set rstNewCopy = rstTemp.Clone
End Sub

Any ideas?

sanon
Aug 27th, 2000, 11:41 AM
If you use ADO, you have to instanciate a recordset varible before using it.

set rs = new recordset

Clunietp
Aug 27th, 2000, 12:19 PM
What is the point of cloning a recordset object that has no fields or data? Why don't you just create a new recordset or clone an existing one (that contains data)?