By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,635 Members | 2,187 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,635 IT Pros & Developers. It's quick & easy.

linking to a password protected database

P: n/a
please help im new at access programming and i just got this project
dropped in my lap because the old programmer quit. i've been doing ok
so far but now i need to add code to an existing database that is used
to connect to other databases and generate reports. below is sample
code of how the database does the linking i hope i give you enough
info to help me but if not let me know and i will give more.

Sub txtShipDataFileSub()

Dim tblShipData As TableDef
Dim ThisDB As Database
Dim Index As Integer

If FileExists(txtShipDataFile.Value) = True Then
StatusWindow_Display "Loading ship data..."
Index = Len(Trim(txtShipDataFile.Value))
Do While Mid(Trim(txtShipDataFile.Value), Index, 1) <>
"\" And Index > 1
Index = Index - 1
Loop
ChangeConfigSetting "ShipDir",
Left(Trim(txtShipDataFile.Value), Index)

StatusWindow_AddMessage "Linking FAST tables..."

Set ThisDB = DBEngine.Workspaces(0).Databases(0)
ConnectTable ThisDB.TableDefs![c2BulkParts],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST CSMP tables..."
ConnectTable ThisDB.TableDefs![c2CSMPED],
txtShipDataFile.Value
If FileExists(GetConfigSetting("ShipDir") &
"config.dbf") Then
ConnectTable ThisDB.TableDefs![tblCSRRConfig],
GetConfigSetting("ShipDir"), "FOXPRO 2.6;DATABASE="
ChangeConfigSetting "UseConfigNames", True
Else
ChangeConfigSetting "UseConfigNames", False
End If
'add new link tables

StatusWindow_AddMessage "Linking FAST parts tables..."
ConnectTable ThisDB.TableDefs![c2Parts],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST SCLSIS
tables..."
ConnectTable ThisDB.TableDefs![c2SCLSIS],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST ShipInfo
tables..."
ConnectTable ThisDB.TableDefs![c2ShipInfo],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST System
tables..."
ConnectTable ThisDB.TableDefs![c2System],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST TrainingNames
tables..."
ConnectTable ThisDB.TableDefs![c2TrainingNames],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST CtrlSheetRanges
tables..."
ConnectTable ThisDB.TableDefs![C5_CtrlSheetRanges],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST EquipConfig
tables..."
ConnectTable ThisDB.TableDefs![C5_EquipConfig],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST Evaluators
tables..."
ConnectTable ThisDB.TableDefs![C5_Evaluators],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST FinalReportInfo
tables..."
ConnectTable ThisDB.TableDefs![C5_FinalReportInfo],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST FollowUps
tables..."
ConnectTable ThisDB.TableDefs![C5_FollowUps],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST MasterEvals
tables..."
ConnectTable ThisDB.TableDefs![C5_MasterEvals],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST MasterQuals
tables..."
ConnectTable ThisDB.TableDefs![C5_MasterQuals],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST MCL tables..."
ConnectTable ThisDB.TableDefs![C5_MCL],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST Qualifications
tables..."
ConnectTable ThisDB.TableDefs![C5_Qualifications],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST SpecialRemarks
tables..."
ConnectTable ThisDB.TableDefs![C5_SpecialRemarks],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST TestPlanRanges
tables..."
ConnectTable ThisDB.TableDefs![C5_TestPlanRanges],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST TestPlans
tables..."
ConnectTable ThisDB.TableDefs![C5_TestPlans],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST EocInfo
tables..."
'ConnectTable ThisDB.TableDefs![C5_VisitInfo],
txtShipDataFile.Value
ConnectTable ThisDB.TableDefs![EocInfo],
txtShipDataFile.Value
StatusWindow_AddMessage "Linking FAST Training
tables..."
ConnectTable ThisDB.TableDefs![C5_Training],
txtShipDataFile.Value
EraseTable "tblTOCIndividualReportsSource"
RecordCounters_CloseTable
DeleteQueries
AppendC2
StatusWindow_AddMessage "Linking FAST tables
complete..."

StatusWindow_Done

End If
End If

End Sub
Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.