Rabu, 27 Juli 2011

[MS_AccessPros] Re: unrecognized database format...is this a reference problem ?

 


John, I did use you suggestions and all is well. I also wanted to thank you for questioning my use of ADO vs DAO, In reality it was a copied snippet of code that caused my mistake. I did go back and read the finer points of DAO and DAO.

TY and thank you pat as well

Terence
--- In MS_Access_Professionals@yahoogroups.com, "patrickawood" <pwood57@...> wrote:
>
> Hi Terence,
>
> 2 Things that may or may not apply to your situation that can give you a bad day if you are not aware of them:
>
> 1) Access 2007 does not set a reference to the ActiveX Data Objects Library for you. You have to set it yourself.
>
> 2) Windows 7 Service Pack 1 "broke" ADODB code. So if you have the SP1 installed so the only way you can get your code to work without uninstalling SP1 is to use Late Binding.
>
> Early Binding:
> Dim cnn As New ADODB.Connection
> Dim rst As New ADODB.Recordset
>
> Late Binding:
> Dim cnn As Object
> Dim rst As Object
>
> Set cnn = CreateObject("ADODB.Connection")
> Set rst = CreateObject("ADODB.Recordset")
>
>
> I like Bill's solution the best.
>
> Kind Regards,
> Pat Wood
> http://accesstips.wordpress.com
>
>
> --- In MS_Access_Professionals@yahoogroups.com, "Terence" <buffalome90210@> wrote:
> >
> > This code worked with MDB, but I am now altering it for accdb. Code is as follows"
> >
> > Dim cnn As New ADODB.Connection
> > Dim rst As New ADODB.Recordset
> >
> > cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> > "Data Source=C:\E_FORM\" & _
> > "Database1.accdb;"
> >
> > rst.Open "Legacy3_filled", cnn, _
> > adOpenKeyset, adLockOptimistic
> >
> > Does anything appear wrong? or am I using the wrong reference components ?
> > Terence
> >
>

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar