1,105,594 Community Members

connect VB 6 to Access 2007

Member Avatar
rucci
Newbie Poster
3 posts since Feb 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hello experts ,
Now this may seem a silly question but i do have to ask . Its a similar question to ones people have posted but not that similar . i would like to connect VB 6 to ACCESS 2007 using ODBC . I have no idea how to go forward with it . e.g where do i write the code , how do i write it , how do i test it to make sure its connected etc , so its the very basic starting point . If anyone could tell me or even point me into the right direction it would be an honour and pleasure to follow .

What should i look for etc ...

your help would be very much appreciated , and God Bless you all .

many Thanks ,

Tahir Rashid .

Member Avatar
debasisdas
Posting Genius
6,542 posts since Feb 2007
Reputation Points: 580 [?]
Q&As Helped to Solve: 476 [?]
Skill Endorsements: 25 [?]
Featured
 
0
 

The simplest solution is to use an UDL file.

Opennotepad and save the file with .UDL extension . No need to write anything in the file.

Then double click the file to open and the other step are self explanatory.

Close the file after checking the connection and write click and open with notepad. Copy only the connection string part and use in VB 6.0 code to open the connection . The access 2007 file will be having .ACCDB format.

Member Avatar
puloksamal
Newbie Poster
2 posts since Jun 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi debasis,

I am creating a databse using access, but I am facing problem in saving the record through form. When i clicjk on the save button the record does nt get saved in the database until the access is not saved. Why is it so?

What is the solution for this.

Member Avatar
puloksamal
Newbie Poster
2 posts since Jun 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I am using Access 2007

Member Avatar
Sameyison
Newbie Poster
5 posts since Oct 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hello,
I am useing vb6 with Access 2007 which connects perfrctly, However my problem is that I cannot bind data to ADODC. Can anyone help me please.

Thanks

Member Avatar
Sameyison
Newbie Poster
5 posts since Oct 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hello,
I am useing vb6 with Access 2007 which connects perfrctly, However my problem is that I cannot bind data to ADODC. Can anyone help me please.
When I go to the data link Property, it only gives me an mdb extension an not accdb, so I cannot select my accdb file.

if I use all file types too, it fails to connect.
Please Help me

Thanks

Sammy

Member Avatar
hkdani
Posting Pro in Training
433 posts since Nov 2007
Reputation Points: 39 [?]
Q&As Helped to Solve: 46 [?]
Skill Endorsements: 2 [?]
 
0
 

DebAsisdas gave a useful suggestion. I've never done it that way. Here's some further information along those lines from the MSDN documentation.

Creating a Front-end Database Application with Minimal Code
It's possible to create a database application using a minimum of code by setting a few properties at design time. If you are using an OLE DB data source, the Microsoft Data Link Name (.UDL) must be created on your machine. See "Creating the Northwind OLE DB Data Link" for a step-by-step example.

To create a simple front-end database application

Draw an ADO Data Control on a form. (The icon's ToolTip is "ADODC.")
If the control is not available in the Toolbox, press CTRL+T to display the Components dialog box. In the Components dialog, click Microsoft ADO Data Control.

On the Toolbox, click the ADO Data Control to select it. Then press F4 to display the Properties window.


In the Properties window, click ConnectionString to display the ConnectionString dialog box.


If you have created a Microsoft Data Link file (.UDL), select Use OLE DB File and click Browse to find the file on the computer. If you use a DSN, click Use ODBC Data Source Name and select a DSN from the box, or click New to create one. If you wish to use create a connection string, select Use ConnectionString, and then click Build, and use the Data Link Properties dialog box to create a connection string. After creating the connection string, click OK. The ConnectionString property will be filled with a string like:
driver={SQL Server};server=bigsmile;uid=sa;pwd=pwd;database=pubs

In the Properties window, set the RecordSource property to a SQL statement. For example,
SELECT * FROM Titles WHERE AuthorID = 72

You should always include a WHERE clause when accessing a table. Failing to do so will lock the entire table, which would be a major hindrance to other users. (MSDN)

Member Avatar
Sameyison
Newbie Poster
5 posts since Oct 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thank you very much for the quick reply, but the problem is not solved.

my problem is that I am having problems with binding access 2007 table to an ADO and for that matter, a combo box. Apart from that, every aspect of the application is working fine.

To further explain this, I have a Table called "Members" which contains names of members of a group, and I also have a data-bound combo box into which I want to pull the names of the members using ADODC.

I am able to do that with access 2003 easily but I am having problems doing that with access 2007. please help me.

Sammy

Member Avatar
hkdani
Posting Pro in Training
433 posts since Nov 2007
Reputation Points: 39 [?]
Q&As Helped to Solve: 46 [?]
Skill Endorsements: 2 [?]
 
0
 

my problem is that I am having problems with binding access 2007 table to an ADO and for that matter, a combo box.

Don't use Microsoft.Jet.OLEDB.4.0 for provider.
You need to use the "Microsoft.ACE.OLEDB.12.0"

The easiest way is to setup a Data Link or a Data Provider.

Member Avatar
Sameyison
Newbie Poster
5 posts since Oct 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Yes, it worked this time.
thanks you very much, hkdani; you are great.

Sammy

Member Avatar
Joni123
Newbie Poster
1 post since Jan 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Dear brothers,

I also want to ask you guys about my problems. I have this VB6 application which uses Ms Access 2003 as a back-end. It was working well on WinXP platform. I want to install the application on a Win7 machine and i am having error on connection string. I have checked on various websites if i can find some help, but with no luck. What must i do to install this application on Win7? Is there any change that i must do on my codding? or do i need any third party? Your quick help will be much appreciated.

Thank you

Member Avatar
Jx_Man
Senior Poster
3,543 posts since Nov 2007
Reputation Points: 987 [?]
Q&As Helped to Solve: 542 [?]
Skill Endorsements: 74 [?]
Featured
 
0
 

Dear brothers,

I also want to ask you guys about my problems. I have this VB6 application which uses Ms Access 2003 as a back-end. It was working well on WinXP platform. I want to install the application on a Win7 machine and i am having error on connection string. I have checked on various websites if i can find some help, but with no luck. What must i do to install this application on Win7? Is there any change that i must do on my codding? or do i need any third party? Your quick help will be much appreciated.

Thank you

How about make your own thread brother...
Don't rise dead thread (its a rule). Just make a new one.

Member Avatar
AndreRet
Industrious Poster
4,492 posts since Jan 2008
Reputation Points: 362 [?]
Q&As Helped to Solve: 499 [?]
Skill Endorsements: 24 [?]
 
0
 

As JX has mentioned, open your own thread here. Your code is fine, its all the different drivers and references that is needed. I will gladly answer once you have your own opened. :)

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article