Error 7005: Rowset not available
Posted on 2002-05-31
I developed a program in Visual Basic 6.0 on my desktop (W98)and now have problems running it on my laptop (W2k). The following error is displayed: 7005 - Rowset not available – and the database name is the caption. I hope someone can tell me what I do wrong.
On the desktop I have Visual Basic and Access installed. On the laptop only Access. They are both hooked onto the local network, so I copied the directory with all the files from the desktop to the laptop. Everything works on the desktop without any problem. I can run the executable file on my laptop and the program starts okay. I can go to screens without any database connection without any problem. But with screens that references the Access database I do have problems.
I had created a table maintance form using the wizard. When loading the screen it is not loading any records in the ADODC. The datagrid stays empty too. When I choose the ‘Refresh’ button, the ADODC indicates the first record, the datagrid stays empty. I can select the ‘last record’ button it shows how much records are in the file, but still no data is shown in the datagrid.
On the form with ADODC that I created from scratch, the datagrid doesn’t load any records either. When I load that screen the message: 7005 - Rowset not available – appears with the database name as caption. That datagrid also doesn’t show any records.
All forms have the connection string build on the ADODC. I have tried to define those in the routines without any success. Therefore, I make sure the directories are the same on both desktop and laptop. The access database has no password. The dabase tables are okay when I open them using Access. They contain all the records. I tried with and without “.Cursorlocation” in the load routinte and in both cases I got the error.
The problem must be with the access database. I just don't know what. The procedure I use for loading:
Private Sub Form_Load()
strSQL = "SELECT * from Industry ORDER BY rank, industry"
strPath = App.Path & "\Stocks.mdb"
'-Build our connection string to use when we open the connection --
connectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & strPath
' initialize our connection to the database
.CursorLocation = adUseClient
.ConnectionString = connectString
.CommandType = adCmdText
' set up the first query
.RecordSource = strSQL
' refresh the data source to make sure the query goes through.
Me.MousePointer = vbDefault
I hope someone can make my day and tell me how I can fix this.