help connecting to Access2000 with VB6 Please 
Author Message
 help connecting to Access2000 with VB6 Please

Hi all,

I'm an webdesigner and work with ASP(VBScript) and Access 2000 and SQL 2000.
Now I decided that I want to use VB6 for some heavy database work.
So what I want is connect to a Access2000 database and loop through the
records.

With Access97 I can connect but thats through the "data" thingie in the
toolbar. But in this way I can't loop through the records.
I have to push forward ( which i'm not after )

With Access 2000 I get a fault unknown database layout.

Any ideas / URL's / some code perhaps ??

THX in advance

Matthew



Fri, 08 Apr 2005 04:03:07 GMT  
 help connecting to Access2000 with VB6 Please
Hi Matthew,
First, You new to see if you have the jet4.0 provider on
your machine.
If you don't you can download it from microsoft.
I am assuming you want to use code to do this, so I will
include a code snippit that you can use as a guide

Option Explicit
Dim cnn As ADODB.Connection
Dim rs As ADODB.Recordset

Set cnn = New ADODB.Connection
With cnn
    .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=" & App.Path & "\YourdbNameHere.mdb;Persist
Security Info=False"
    .Open
End With

Set rs = New ADODB.Recordset
    With rs
        .Open "Select * from TableNameHere", cnn,
adOpenStatic, , adCmdText
    End With
Do While Not rs.EOF = True
    Code to find what you are looking for here
    rs.movenext
Loop

'Close rs and cnn objects and destroy to reclaim
'memory
rs.close
cnn.close
Set rs = nothing
set cnn = nothing

Hope this helps
Ed Voss
MCP

Quote:
>-----Original Message-----
>Hi all,

>I'm an webdesigner and work with ASP(vbscript) and

Access 2000 and SQL 2000.
Quote:
>Now I decided that I want to use VB6 for some heavy
database work.
>So what I want is connect to a Access2000 database and
loop through the
>records.

>With Access97 I can connect but thats through the "data"
thingie in the
>toolbar. But in this way I can't loop through the
records.
>I have to push forward ( which i'm not after )

>With Access 2000 I get a fault unknown database layout.

>Any ideas / URL's / some code perhaps ??

>THX in advance

>Matthew

>.



Fri, 08 Apr 2005 05:15:30 GMT  
 help connecting to Access2000 with VB6 Please
THX for replying Ed !!!
This is what I'm looking for.

This will get me started :)
I'll give it a go and get back to you here !!

One more question.
I use jet 4.0 in my asp connection string.
Does that mean this is valid for VB6 also ???

THX again
Matthew


Quote:
> Hi Matthew,
> First, You new to see if you have the jet4.0 provider on
> your machine.
> If you don't you can download it from microsoft.
> I am assuming you want to use code to do this, so I will
> include a code snippit that you can use as a guide

> Option Explicit
> Dim cnn As ADODB.Connection
> Dim rs As ADODB.Recordset

> Set cnn = New ADODB.Connection
> With cnn
>     .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;
> Data Source=" & App.Path & "\YourdbNameHere.mdb;Persist
> Security Info=False"
>     .Open
> End With

> Set rs = New ADODB.Recordset
>     With rs
>         .Open "Select * from TableNameHere", cnn,
> adOpenStatic, , adCmdText
>     End With
> Do While Not rs.EOF = True
>     Code to find what you are looking for here
>     rs.movenext
> Loop

> 'Close rs and cnn objects and destroy to reclaim
> 'memory
> rs.close
> cnn.close
> Set rs = nothing
> set cnn = nothing

> Hope this helps
> Ed Voss
> MCP

> >-----Original Message-----
> >Hi all,

> >I'm an webdesigner and work with ASP(vbscript) and
> Access 2000 and SQL 2000.
> >Now I decided that I want to use VB6 for some heavy
> database work.
> >So what I want is connect to a Access2000 database and
> loop through the
> >records.

> >With Access97 I can connect but thats through the "data"
> thingie in the
> >toolbar. But in this way I can't loop through the
> records.
> >I have to push forward ( which i'm not after )

> >With Access 2000 I get a fault unknown database layout.

> >Any ideas / URL's / some code perhaps ??

> >THX in advance

> >Matthew

> >.



Fri, 08 Apr 2005 05:37:22 GMT  
 help connecting to Access2000 with VB6 Please
Matthew,
The Jet4.0 is good in any language.
Also i forgot to mention that you will need to set a
referance to the Microsoft ActiveX Data Objects 2.7
library.(or whichever mado 2. something library is on
your computer)
You do this by selecting referances under the project
menu in VB, then putting a check next to the mado library.
Gool Luck
Ed Voss
MCP

Quote:
>-----Original Message-----
>THX for replying Ed !!!
>This is what I'm looking for.

>This will get me started :)
>I'll give it a go and get back to you here !!

>One more question.
>I use jet 4.0 in my asp connection string.
>Does that mean this is valid for VB6 also ???

>THX again
>Matthew



>> Hi Matthew,
>> First, You new to see if you have the jet4.0 provider
on
>> your machine.
>> If you don't you can download it from microsoft.
>> I am assuming you want to use code to do this, so I
will
>> include a code snippit that you can use as a guide

>> Option Explicit
>> Dim cnn As ADODB.Connection
>> Dim rs As ADODB.Recordset

>> Set cnn = New ADODB.Connection
>> With cnn
>>     .ConnectionString

= "Provider=Microsoft.Jet.OLEDB.4.0;

- Show quoted text -

Quote:
>> Data Source=" & App.Path & "\YourdbNameHere.mdb;Persist
>> Security Info=False"
>>     .Open
>> End With

>> Set rs = New ADODB.Recordset
>>     With rs
>>         .Open "Select * from TableNameHere", cnn,
>> adOpenStatic, , adCmdText
>>     End With
>> Do While Not rs.EOF = True
>>     Code to find what you are looking for here
>>     rs.movenext
>> Loop

>> 'Close rs and cnn objects and destroy to reclaim
>> 'memory
>> rs.close
>> cnn.close
>> Set rs = nothing
>> set cnn = nothing

>> Hope this helps
>> Ed Voss
>> MCP

>> >-----Original Message-----
>> >Hi all,

>> >I'm an webdesigner and work with ASP(vbscript) and
>> Access 2000 and SQL 2000.
>> >Now I decided that I want to use VB6 for some heavy
>> database work.
>> >So what I want is connect to a Access2000 database and
>> loop through the
>> >records.

>> >With Access97 I can connect but thats through
the "data"
>> thingie in the
>> >toolbar. But in this way I can't loop through the
>> records.
>> >I have to push forward ( which i'm not after )

>> >With Access 2000 I get a fault unknown database
layout.

>> >Any ideas / URL's / some code perhaps ??

>> >THX in advance

>> >Matthew

>> >.

>.



Fri, 08 Apr 2005 06:00:40 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

2. Problem connecting to Access2000 database...pls, pls help.

3. VB6/Access2000 Help

4. Help!! VB6 vs Access2000

5. HELP: Can't find installable ISAM VB6/Access2000/Win98

6. HELP: H2 Open an ACCESS2000 DB FROM OUT VB6

7. Can anyone HELP me PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE

8. Can't connect to Access2000 database

9. connecting to access2000 via ado?

10. Crystal Report Connecting to Access2000

11. not able to connect to access2000

12. problems connecting access2000 db

 

 
Powered by phpBB® Forum Software