Establishing a data connection from within Access to Visio

O

Opa Horst

I have a VBA program in Visio which loads data from an Access database, works
perfectly.
Now rather then working from Visio, I would like to start from Access and
then open Visio and generate a drawing based on the Access data. Starting the
same VBA script in Access throws an error – database locked – which is
understandable as the database is open. Opening as read only doesn’t work.
Is there any workaround for this?
Secondly I would like to use the runtime version of Visio and hide the user
interface. Here I get an error which seems to indicate that data access is
not supported in the runtime version.
Is that correct or do I something wrong?
 
D

David Parker

What data linking methodology are you employing?
What version Access and Visio?
What do you mean "runtime version" of Visio?
 
O

Opa Horst

Thank you for your reply!
Here the answers:
1. Data link methodology – ADO, code snippet:
Set RecSet = CurrentDoc.DataRecordsets.Add( ADOConnectionString,
SelectionString, 0, Name)
Where ADOConnectionString is:
Provider=Microsoft.ACE.OLEDB.12.0;" & _
"User ID=Admin;" & _
"Data Source=" & AccessDb & ";" & _
"Mode=Read;" & _
"Extended Properties="""";" & _
"Jet OLEDB:System database="""";" & _
"Jet OLEDB:Registry Path="""";" & _
"Jet OLEDB:Engine Type=6;" & _
"Jet OLEDB:Database Locking Mode=1;" & _
"Jet OLEDB:Global Partial Bulk Ops=2;" & _
"Jet OLEDB:Global Bulk Transactions=1;" & _
"Jet OLEDB:New Database Password="""";" & _
"Jet OLEDB:Create System Database=False;" & _
"Jet OLEDB:Encrypt Database=False;" & _
"Jet OLEDB:Don't Copy Locale on Compact=False;" & _
"Jet OLEDB:Compact Without Replica Repair=False;" & _
"Jet OLEDB:SFP=False;Jet OLEDB:Support Complex Data=False"

With AccessDb a constant pointing to the database.

2. Access and Visio version is 2007
3. With the runtime Visio I meant the MS ActiveX Visio Drawing Control
 
O

Opa Horst

Thank you for your reply!
Here the answers:
1. Data link methodology – ADO, code snippet:
Set RecSet = CurrentDoc.DataRecordsets.Add( ADOConnectionString,
SelectionString, 0, Name)
Where ADOConnectionString is:
Provider=Microsoft.ACE.OLEDB.12.0;" & _
"User ID=Admin;" & _
"Data Source=" & AccessDb & ";" & _
"Mode=Read;" & _
"Extended Properties="""";" & _
"Jet OLEDB:System database="""";" & _
"Jet OLEDB:Registry Path="""";" & _
"Jet OLEDB:Engine Type=6;" & _
"Jet OLEDB:Database Locking Mode=1;" & _
"Jet OLEDB:Global Partial Bulk Ops=2;" & _
"Jet OLEDB:Global Bulk Transactions=1;" & _
"Jet OLEDB:New Database Password="""";" & _
"Jet OLEDB:Create System Database=False;" & _
"Jet OLEDB:Encrypt Database=False;" & _
"Jet OLEDB:Don't Copy Locale on Compact=False;" & _
"Jet OLEDB:Compact Without Replica Repair=False;" & _
"Jet OLEDB:SFP=False;Jet OLEDB:Support Complex Data=False"

With AccessDb a constant pointing to the database.

2. Access and Visio version is 2007
3. With the runtime Visio I meant the MS ActiveX Visio Drawing Control
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top