
- JIO TV APP FOR WINDOWS PHONE SOFTWARE
- JIO TV APP FOR WINDOWS PHONE CODE
‘strMsg will be a zero-length string if there is no error message.ĭebug.Print “All Tables were successfully relinked.” ‘Run the Procedure, getting any error messages.
JIO TV APP FOR WINDOWS PHONE CODE
The code below shows one way to call the procedure and use the MsgBox to display errors. However, you can use the MsgBox if need to notify the user when one or more of the tables fails to be relinked or there is an error. This allows you to quietly record the successful relinking of tables in the Immediate Window instead of using an annoying MsgBox that pops up every time you open the database. The above procedure only returns a message string if an error has occurred. StrMsg = strMsg & vbNewLine & “Table Name: ” & tdf.Name & vbNewLine StrMsg = strMsg & “Error ” & Err.Number & ” ” & Err.Description & vbNewLine & strMsg & “In Procedure RefreshTableLinks” StrMsg = “There were errors refreshing the table links: ” _ StrMsg = strMsg & “Connect = ” & strCon & vbNewLine StrMsg = strMsg & “Table Name: ” & tdf.Name & vbNewLine StrMsg = strMsg & “Error getting back-end database name.” & vbNewLine ‘Add the information to the message to notify the user. ‘There was a problem getting the name of the back-end. Tdf.Connect = “ DATABASE=” & CurrentProject.Path & strBackEnd
‘Build the new Connection Property Value. StrBackEnd = Right$(strCon, (Len(strCon) – (InStrRev(strCon, “”) – 1))) ‘Get the name of the back-end database using String Functions. If Left$(tdf.Connect, 10) = “ DATABASE=” Then Public Function RefreshTableLinks() As String ‘ Return: Or returns a string listing tables not relinked and errors. ‘ Return: Returns a zero-length string if all tables are relinked. ‘ Note: Linked Tables can be in more than one back-end. ‘ Purpose: Refresh table links to back-ends in the same folder as front end. So you could use other procedures in unbound forms, such as a Splash form, before calling the RefreshTableLinks procedure. To be more precise, the code must be run before a bound form loads data from the tables.
It will not relink ODBC, Excel, Outlook, dBASE, Paradox or any other type of linked table or object.ġ) The front-end and back-end tables must be in the same folder.įulfilling this requirement allows the files to be moved to any folder, or a different computer, and the code will automatically relink the tables.Ģ) The code that calls the RefreshTableLinks procedure must be added to the Form Open Event of the first form to be loaded or called by an AutoExec macro. It will not relink tables that are in back-ends that have been renamed. It will not refresh the links of tables that have been renamed or moved to other back-ends. It will not relink Access database tables unless they have already been linked. There are a few things the code will not do: Unlike some methods, will not lose your linked table or TableDef if there is an error. Does not require you enter or store database or table names. Relink tables in multiple back-end Access databases. Relink tables when the databases are moved to a different folder or a different computer. Relink all linked Access database tables if the back-end and front-end are in the same folder. The code loops through the TableDefs Collection and uses the TableDef RefreshLink Method to Refresh the links. The code then uses this information along with the existing path of the front-end database to get the string needed to set the TableDef Connect Property. This includes the names of your linked tables and the names of your back-end databases. The code gets important information from the TableDefs collection in your front-end. Additionally, you do not have to enter the names of your back end database(s) or your linked tables. You do not have to be physically present, nor do you need to remotely access another computer. It can save you a lot of headaches, trouble, travel, and time. This is especially true if you are distributing your database to others. And best of all, you don’t have to know much about writing code to make this work.Īutomating the relinking of tables just makes good sense. The procedure will also relink the tables in multiple back-ends. For more information, contact this article we will show you how you can call a single procedure using just a little code to automatically relink your back-end tables, even when the database files have been moved to a different folder.
He also founded Microsoft Access and SQL Azure Information Cente r for developers.
JIO TV APP FOR WINDOWS PHONE SOFTWARE
( Guest blogger Patrick Wood, an Access MVP, is the founder of Gaining Access Technologies, a software company specializing in working with SQL Azure and Access.