Removing database link

B

Blackend

I have made a drawing wich have some shapes linked to a database (Access).
Now a customer would like to have copy's of my drawing.
My customer dosen't have the database, but i still whan't him to be able to
use the "smart" symbols on the drawing.

I have tryed to manualy delte the User.ODBCConnection on the shapesheet, and
then everything works fine - the DB link is gone.

Now all i whant to do (To help my colleagues, so they don't need to open the
ShapeSheet (They are not programmers)) is to make a menu (Right click on the
shape/page) and then with a macro or something else, remove the database
connection (maby by removing the User.ODBCConnection line).
Only thing is - i don't know how to do this.
Maby there is a much better way of doing this?

Anyone?

Thanks in advance
Ulrik
 
I

Iwan van Ee

With the following code you can remove the User.ODBCConnection cell.
But maybe you only want to clear the cell and not remove it?
Clearing the cell after checking if the cell exists:
shpObj.Cells("User.ODBCConnection").Formula = ""

Add an action section to the pagesheet and call this prucedure.

=====================
Public Sub RemoveDBLink()
Dim shpObj As Shape
Dim iRow As Integer

For Each shpObj In ActivePage.Shapes
If shpObj.CellExists("User.ODBCConnection", False) Then
For iRow = 0 To shpObj.RowCount(visSectionUser) - 1
If shpObj.CellsSRC(visSectionUser, iRow, 0).Name =
"User.ODBCConnection" Then
shpObj.DeleteRow visSectionUser, iRow
Exit For
End If
Next iRow
End If
Next shpObj
End Sub
======================
 
I

Iwan van Ee

With the following code you can remove the User.ODBCConnection cell.
But maybe you only want to clear the cell and not remove it?
Clearing the cell after checking if the cell exists:
shpObj.Cells("User.ODBCConnection").Formula = ""

Add an action section to the pagesheet and call this prucedure.

=====================
Public Sub RemoveDBLink()
Dim shpObj As Shape
Dim iRow As Integer

For Each shpObj In ActivePage.Shapes
If shpObj.CellExists("User.ODBCConnection", False) Then
For iRow = 0 To shpObj.RowCount(visSectionUser) - 1
If shpObj.CellsSRC(visSectionUser, iRow, 0).Name =
"User.ODBCConnection" Then
shpObj.DeleteRow visSectionUser, iRow
Exit For
End If
Next iRow
End If
Next shpObj
End Sub
======================

Blackend said:
I have made a drawing wich have some shapes linked to a database (Access).
Now a customer would like to have copy's of my drawing.
My customer dosen't have the database, but i still whan't him to be able to
use the "smart" symbols on the drawing.
......
 
I

Iwan van Ee

With the following code you can remove the User.ODBCConnection cell.
But maybe you only want to clear the cell and not remove it?
Clearing the cell after checking if the cell exists:
shpObj.Cells("User.ODBCConnection").Formula = ""

Add an action section to the pagesheet and call this prucedure.

=====================
Public Sub RemoveDBLink()
Dim shpObj As Shape
Dim iRow As Integer

For Each shpObj In ActivePage.Shapes
If shpObj.CellExists("User.ODBCConnection", False) Then
For iRow = 0 To shpObj.RowCount(visSectionUser) - 1
If shpObj.CellsSRC(visSectionUser, iRow, 0).Name =
"User.ODBCConnection" Then
shpObj.DeleteRow visSectionUser, iRow
Exit For
End If
Next iRow
End If
Next shpObj
End Sub
======================
 
I

Iwan van Ee

With the following code you can remove the User.ODBCConnection cell.
But maybe you only want to clear the cell and not remove it?
Clearing the cell after checking if the cell exists:
shpObj.Cells("User.ODBCConnection").Formula = ""

Add an action section to the pagesheet and call this prucedure.

=====================
Public Sub RemoveDBLink()
Dim shpObj As Shape
Dim iRow As Integer

For Each shpObj In ActivePage.Shapes
If shpObj.CellExists("User.ODBCConnection", False) Then
For iRow = 0 To shpObj.RowCount(visSectionUser) - 1
If shpObj.CellsSRC(visSectionUser, iRow, 0).Name =
"User.ODBCConnection" Then
shpObj.DeleteRow visSectionUser, iRow
Exit For
End If
Next iRow
End If
Next shpObj
End Sub
======================
 
B

Blackend

Just whgat i needed

Thanks m8

;)

Iwan van Ee said:
With the following code you can remove the User.ODBCConnection cell.
But maybe you only want to clear the cell and not remove it?
Clearing the cell after checking if the cell exists:
shpObj.Cells("User.ODBCConnection").Formula = ""

Add an action section to the pagesheet and call this prucedure.

=====================
Public Sub RemoveDBLink()
Dim shpObj As Shape
Dim iRow As Integer

For Each shpObj In ActivePage.Shapes
If shpObj.CellExists("User.ODBCConnection", False) Then
For iRow = 0 To shpObj.RowCount(visSectionUser) - 1
If shpObj.CellsSRC(visSectionUser, iRow, 0).Name =
"User.ODBCConnection" Then
shpObj.DeleteRow visSectionUser, iRow
Exit For
End If
Next iRow
End If
Next shpObj
End Sub
======================


.....
 
V

Vondre Daniel

How did you define the ODBC connection string with in the shapesheet? How
would you use a connection string to connect from a visio shape to an Access
Database? Internally and externally?
 

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