Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visio/MS Access Database Connection

Status
Not open for further replies.

stubailey

Programmer
Jan 29, 2003
3
GB
Hi,

Being a very new visio developer (2 hours in) but an experienced Access Developer, I need some help connecting Visio to Access. I need to connect to a table and then create a visio layout on the contained info. I am basically doing a technical drawing which will need 2 sorts of shapes. A typical diagram would show Item type 1 links to 3 item type 2s, which in turn link to another item type 1 ,which may link to 2 more item type 2s. Each item has a unique number.

Does anybody know where a good example or something is posted, or could anyone send me some code to get started.

Any help much appreciated

Cheers

Stu
 
I have found the tools for DBS connection very limited. Could only really link part numbers and properties. I needed to have the shape change based on table values and have the shape link to several different tables. So I used VBA code. Problem with this solution is you will get the message on macros every time you start. I use VB to create an add-in solution to avoid this.

In the VBA environment:
You will need to add the reference for DAO 3.6



public sub TestDB()
dim dbDatabase as DAO.Database
dim rstTemp as DAO.Recordset

set dbDatabase = open.database("C:\MyDirectory\MyDB.mdb")
'some flags can be set to open as read only
set rstTemp = dbDatabase.openrecorset("Select * From Table")
while not(rsttemp.eof)
msgbox "Field value: " & rsttemp.fields("PartNumber")
wend
rsttemp.close
dbsDatabase.close
set rsttemp = nothing
set dbsdatabase = nothing
end sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top