? Marks in Linked table manager

jeff_i

Registered User.
Local time
Today, 02:40
Joined
Jan 24, 2003
Messages
50
Why am I getting question marks in the linked table manager? When I manually link tables the show as icons, when I use code the show up as question marks.
 
You probably haven't defined something completely in the code. Some attribute is required to tell Access what kind of table you have. When you see a question-mark icon, you are missing some parameter of the method or action you employed.
 
The_Doc_Man said:
You probably haven't defined something completely in the code. Some attribute is required to tell Access what kind of table you have. When you see a question-mark icon, you are missing some parameter of the method or action you employed.


I found most of this on this site but I am trying to pass a password to the backend database. This way I can prevent people from using anything but my frontend to edit the data.

Code:
Function Relinktables()

Dim dbs As DAO.Database
Dim db As DAO.Database
Dim tdfNew As DAO.TableDef
Dim tdf As DAO.TableDef

Dim i As Integer
Dim strTableName As String
Dim strLinkDb As String
Dim strNameDb As String
Dim dbProtected As Database
Dim wrk As Workspace

Set db = CurrentDb

'Set wrk = DBEngine.Workspaces(0)
Set dbProtected = OpenDatabase("c:\jeff.i\activedatabases\dcprma\testingsecurity\dcpfrr19_be.mdb", False, False, ";PWD=abc")

'strNameDb = "dcpfrr19_be.mdb"

strLinkDb = "C:\jeff.i\activedatabases\dcprma\testingsecurity\dcpfrr19_be.mdb"
For Each tdf In db.TableDefs

If Len(tdf.Connect) > 0 Then
DoCmd.DeleteObject acTable, tdf.Name
End If
Next

Set dbs = OpenDatabase(strLinkDb)
For i = 0 To dbs.TableDefs.Count - 1
If Not dbs.TableDefs(i).Name Like "Msys*" Then

strTableName = dbs.TableDefs(i).Name
Set tdfNew = db.CreateTableDef(strTableName)
tdfNew.Connect = ";DATABASE=" & strLinkDb
tdfNew.SourceTableName = strTableName
db.TableDefs.Append tdfNew
End If
Next i



With Application
.RefreshDatabaseWindow
End With

End Function

'Public Sub pop()

'Dim db As Database
'Dim tdf As TableDef

'Set db = CurrentDb

'Debug.Print db.TableDefs(0).Name


'End Sub
 
By the way thanks for the reply I apperciate any help!
 

Users who are viewing this thread

Back
Top Bottom