473,503 Members | 2,197 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DAO to ADODB Listbox conversion. Upsizing to SQL

Hi all

I have written a database in access and used ADODB recordsets all the
way through. The only recordsets that are not ADODB are the listbox
navigation code automatically generated by access 2003 as follows :

' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ClientID] = " & Str(Nz(Me![lstclient], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

I have tried doing the above by putting the following code into an
ADODB

Function ADODB_Goto_Record(frm As Form, fieldname As String, val As
Variant)

Dim Clone_RST As ADODB.Recordset

Set Clone_RST = frm.RecordsetClone
With Clone_RST
If Not (.EOF And .BOF) Then
Do Until .EOF
'Records Found So Check for 'strCriteria'
.Find "[" & fieldname & "] = " & val

'When found Goto record
'Forms!FormName.Bookmark = .Bookmark
frm.Bookmark = .Bookmark
'Moves Record set to next one
'.MoveNext - not sure if i need this as i cant get in to
test it
Loop
Else
'No Records Found,
End If
.Close
End With

Set Clone_RST = Nothing
Now this gives a 'type mismatch' error at the recordset.clone line.

Now i understand that the form will try to insert a
DAO.recordeset.clone into Clone_Rst which is obviously the cause of
the error.

I have changed the record source of the form to an SQL statement but i
still cant clone the current form recordset in ADODB and i've spent
ages on this

Can anyone HELP????

Someone out there must have successfully upsized to an SQL backend
using list boxes to navigate with.

Thanks in advance

Feb 21 '07 #1
7 2892
bo*****@gmail.com wrote in news:1172064363.189384.259710
@m58g2000cwm.googlegroups.com:

What is the recordsource of the form? How did you make the form's
recordsource an ADODB recordeset?

After we know that, we could be more helpful in suggesting how you could
use a list box to identify a record on the form and to move to it.
Feb 21 '07 #2
On 21 Feb, 13:54, Lyle Fairfield <n...@thanks.comwrote:
boyl...@gmail.com wrote in news:1172064363.189384.259710
@m58g2000cwm.googlegroups.com:

What is the recordsource of the form? How did you make the form's
recordsource an ADODB recordeset?

After we know that, we could be more helpful in suggesting how you could
use a list box to identify a record on the form and to move to it.
Hi i didnt make it an ADODB recordset. I was just saying that the
recordsetclone is a mismatch as the forms recordsource is DAO.

I cant clone the forms recordset in an ADODB function.

All i did was change the frm.recordsource property from "invoice" to
SELECT * FROM Invoice;

Which didnt change anything really

Just need to know how to use bookmarks and recordsetclone to navigate
using a listbox in ADO

I tried on a blank database and still couldnt get it to work

Feb 21 '07 #3
On Feb 21, 9:51 am, boyl...@gmail.com wrote:
On 21 Feb, 13:54, Lyle Fairfield <n...@thanks.comwrote:
boyl...@gmail.com wrote in news:1172064363.189384.259710
@m58g2000cwm.googlegroups.com:
What is the recordsource of the form? How did you make the form's
recordsource an ADODB recordeset?
After we know that, we could be more helpful in suggesting how you could
use a list box to identify a record on the form and to move to it.

Hi i didnt make it an ADODB recordset. I was just saying that the
recordsetclone is a mismatch as the forms recordsource is DAO.

I cant clone the forms recordset in an ADODB function.

All i did was change the frm.recordsource property from "invoice" to
SELECT * FROM Invoice;

Which didnt change anything really

Just need to know how to use bookmarks and recordsetclone to navigate
using a listbox in ADO

I tried on a blank database and still couldnt get it to work

Hmmm

The forms recordset is DAO?

And you want to set an ADODB recordset to the form recordset's clone?

as in:
Dim Clone_RST As ADODB.Recordset
Set Clone_RST = frm.RecordsetClone

And it gives you a type mismatch error?

I suggest you use

Dim Clone_RST As DAO.Recordset

and use FindFirst and NoMatch to locate the record.

Feb 21 '07 #4
On 21 Feb, 15:07, "Lyle Fairfield" <lylefairfi...@aim.comwrote:
On Feb 21, 9:51 am, boyl...@gmail.com wrote:


On 21 Feb, 13:54, Lyle Fairfield <n...@thanks.comwrote:
boyl...@gmail.com wrote in news:1172064363.189384.259710
@m58g2000cwm.googlegroups.com:
What is the recordsource of the form? How did you make the form's
recordsource an ADODB recordeset?
After we know that, we could be more helpful in suggesting how you could
use a list box to identify a record on the form and to move to it.
Hi i didnt make it an ADODB recordset. I was just saying that the
recordsetclone is a mismatch as the forms recordsource is DAO.
I cant clone the forms recordset in an ADODB function.
All i did was change the frm.recordsource property from "invoice" to
SELECT * FROM Invoice;
Which didnt change anything really
Just need to know how to use bookmarks and recordsetclone to navigate
using a listbox in ADO
I tried on a blank database and still couldnt get it to work

Hmmm

The forms recordset is DAO?

And you want to set an ADODB recordset to the form recordset's clone?

as in:
Dim Clone_RST As ADODB.Recordset
Set Clone_RST = frm.RecordsetClone

And it gives you a type mismatch error?

I suggest you use

Dim Clone_RST As DAO.Recordset

and use FindFirst and NoMatch to locate the record.- Hide quoted text -

- Show quoted text -
Hi thats the way it is at the minute but I need to upsize to an SQL
backend which doesnt support DAO

Therefor i need the code (not just for this database but any DB) that
allows me to do the code you suggested but using the ADODB method NOT
the DAO method

Feb 21 '07 #5
bo*****@gmail.com wrote in
news:11*********************@v33g2000cwv.googlegro ups.com:
On 21 Feb, 15:07, "Lyle Fairfield" <lylefairfi...@aim.comwrote:
>On Feb 21, 9:51 am, boyl...@gmail.com wrote:


On 21 Feb, 13:54, Lyle Fairfield <n...@thanks.comwrote:
boyl...@gmail.com wrote in news:1172064363.189384.259710
@m58g2000cwm.googlegroups.com:
What is the recordsource of the form? How did you make the form's
recordsource an ADODB recordeset?
After we know that, we could be more helpful in suggesting how
you could use a list box to identify a record on the form and to
move to it.
Hi i didnt make it an ADODB recordset. I was just saying that the
recordsetclone is a mismatch as the forms recordsource is DAO.
I cant clone the forms recordset in an ADODB function.
All i did was change the frm.recordsource property from "invoice"
to SELECT * FROM Invoice;
Which didnt change anything really
Just need to know how to use bookmarks and recordsetclone to
navigate using a listbox in ADO
I tried on a blank database and still couldnt get it to work

Hmmm

The forms recordset is DAO?

And you want to set an ADODB recordset to the form recordset's clone?

as in:
Dim Clone_RST As ADODB.Recordset
Set Clone_RST = frm.RecordsetClone

And it gives you a type mismatch error?

I suggest you use

Dim Clone_RST As DAO.Recordset

and use FindFirst and NoMatch to locate the record.- Hide quoted text
-

- Show quoted text -

Hi thats the way it is at the minute but I need to upsize to an SQL
backend which doesnt support DAO

Therefor i need the code (not just for this database but any DB) that
allows me to do the code you suggested but using the ADODB method NOT
the DAO method
How will you connect to the backend? If ODBC then I suspect that you will
have to do nothing to your original code at all.
I'm not sure where you got the notion "an SQL backend doesn't support
DAO." SQL Server is a database engine. It doesn't "support" any
connection technology. Connection technologies may have drivers that
allow them to connect to various Databases. DAO does not connect directly
to SQL Server. But neither does ADO; it uses an OLEDb layer.

Of course, if you going to move to an ADP application then you will not
be using DAO. But in that case your Form recordset will be an ADO
recordset, and so there will not be a type mismatch error as you report.

IMO you are solving a problem which is unlikely tocome up.
Feb 21 '07 #6
bo*****@gmail.com wrote in
news:11*********************@v33g2000cwv.googlegro ups.com:
I need to upsize to an SQL
backend which doesnt support DAO
Um, bookmark navigation via the Recordsetclone doesn't involve the
back end.

And if you're using an MDB to your SQL Server back end, then Jet is
involved, which means DAO is appropriate.

I wouldn't use ADO at all. Ever.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Feb 21 '07 #7
On 21 Feb, 19:43, "David W. Fenton" <XXXuse...@dfenton.com.invalid>
wrote:
boyl...@gmail.com wrote innews:11*********************@v33g2000cwv.googleg roups.com:
I need to upsize to an SQL
backend which doesnt support DAO

Um, bookmark navigation via the Recordsetclone doesn't involve the
back end.

And if you're using an MDB to your SQL Server back end, then Jet is
involved, which means DAO is appropriate.

I wouldn't use ADO at all. Ever.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Thanks

I was under the assumption that DAO couldnt be used with a connection
to the SQL server.

I tested the theory and DAO navigation works fine when connecting to
an SQL backend, so thanks to you all as i seem to be creating problems
that dont need solving :-)

regards

Feb 22 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1509
by: Big Time | last post by:
I have an Access 2000 DB that I've been considering upsizing to SQL Server 2K. I'm wondering if anyone can share their experiences in upsizing and let me know of any tips or pratfalls. I've been...
0
4599
by: Bon | last post by:
Hello All I got "Tables are skipped or export failed" error when I used upsizing wizard on migrating MS Access 2000 to MS SQL Server 2000. I am changing my application backend database from MS...
26
3775
by: David W. Fenton | last post by:
A client is panicking about their large Access application, which has been running smoothly with 100s of thousands of records for quite some time. They have a big project in the next year that will...
0
2630
by: CFW | last post by:
I thought this was going to be easy but I'm missing something . . . I need to open an ADODB recordset using the recordset source for a list box on my for. When my form opens, the list box ADODB...
7
497
by: brett valjalo | last post by:
Hey Folks: Long time no see! Hope everyone is well. I have an old mdb I'm upsizing to an adp. There is a button on a form which executes code similar to the following (this is a search form...
2
1520
by: Big Time | last post by:
I have an Access 2000 DB that I've been considering upsizing to SQL Server 2K. I'm wondering if anyone can share their experiences in upsizing and let me know of any tips or pratfalls. I've been...
7
3018
by: JM | last post by:
I'm using Access 2003 to attempt an upsize to SQL Server 2000. The Upsizing Wizard is giving me tons of problems with error messages like: 1. "Object is invalid. Extended properties not...
1
2267
by: bala | last post by:
Hi Access Gurus The MS Access DB (MS Access 2002 Database) which is currently serving as the backend Database to MS Access (MS Access 2002/XP) frontend needs to be converted to Oracle 8i Backend...
5
8428
by: muriwai | last post by:
Hi, I have a C# assembly project under Visual Stuio 2008 Pro on Windows Server 2008. I converted the project from VS 2005. The project references COM->Microsoft CDO for Windows 2000 Library...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5594
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5022
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3168
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
746
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.