473,657 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Recreate a deleted linked table

I upsized a database to SQL and accidentally deleted a table, how can
I recreate that linked table?
Nov 12 '05 #1
4 3657
Row by painful row.

Unless of course you made a backup of your database before you upsided? Or
backed up the SQL code for the table (this would only allow you to recreate
the table and not restore the data)?

If you made a backup, you can just import the table.

"Lisa" <li******@yahoo .com> wrote in message
news:ef******** *************** ***@posting.goo gle.com...
I upsized a database to SQL and accidentally deleted a table, how can
I recreate that linked table?

Nov 12 '05 #2
"Lisa" <li******@yahoo .com> wrote in message
news:ef******** *************** ***@posting.goo gle.com...
I upsized a database to SQL and accidentally deleted a table, how can
I recreate that linked table?


Assuming this is an Access database with linked ODBC tables and you have
simply deleted the linked table from within Access - not the actual data.

File>Get External Data>Link Tables
Select Files of Type = ODBC
Then find your DSN, etc

Wasn't that how you originally created them?
Nov 12 '05 #3
I upsized the database to SQL using the upsizing wizard. So their seems
to be a DSN-less connection. So when you go to:
File> Get External Data....there is no DSN for the database. How do you
get around that?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #4
"Lisa Herrmann" <li******@yahoo .com> wrote in message
news:3f******** *************@n ews.frii.net...
I upsized the database to SQL using the upsizing wizard. So their seems
to be a DSN-less connection. So when you go to:
File> Get External Data....there is no DSN for the database. How do you
get around that?

You could write a more generalised function, but if you simply need the
table re-linked, then create a form with a button on it named cmdLink and
paste the following code in the click event for the button. You just need
to replace 'MyServer', 'MyDatabase', etc with the appropriate values and
also decide whether you use a trusted connection or not. (In case you don't
already have it, you will have to set a reference to the DAO object library)
Private Sub cmdLink_Click()

On Error GoTo Err_Handler

Dim dbs As DAO.Database
Dim tdf As DAO.TableDef
Dim strConnect As String

strConnect = "ODBC;Driver={S QL Server};"
strConnect = strConnect & "Server=MyServe r;"
strConnect = strConnect & "Database=MyDat abase;"
'Either this:
'strConnect = strConnect & "Trusted_Connec tion = Yes"
'Or this:
strConnect = strConnect & "UID=sa;"
strConnect = strConnect & "PWD=MyPassword ;"

Set dbs = CurrentDb
Set tdf = dbs.CreateTable Def("tblMyTable ")

tdf.Connect = strConnect

tdf.SourceTable Name = "tblMyTable "

dbs.TableDefs.A ppend tdf

Exit_Handler:

If Not tdf Is Nothing Then
Set tdf = Nothing
End If

If Not dbs Is Nothing Then
Set dbs = Nothing
End If

Exit Sub

Err_Handler:
MsgBox Err.Description , vbExclamation, "Error No: " & Err.Number
Resume Exit_Handler

End Sub
HTH

Fletcher
Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4165
by: Thomas Bartkus | last post by:
What can I do about my Access Linked ODBC tables showing the #Deleted error? I am using MySQL ODBC 3.51 Driver and Access 2000. I can create linked tables to the MySQL database running remotely on a Linux box. Unfortunately, when you open the table (in Access), all the data are filled with error values. This one is driving me crazy because I can successfully read and write to
8
8090
by: Klemens | last post by:
The linked table has a bigint in primary key columns. I've read that service pack 8 on Jet should solve this but it didn't. On patch1 options I only found to map timestamp to char(26) entry for similar problems on timestamp fields but nothing for Bigint. DB2 is UDB8.1 Fix 6 on Win2000 Are there any other solutions? Thanks Klemens
7
11826
by: Joe | last post by:
I am using Access 2003 and are linking to an Oracle 9i ODBC datasource (using Oracle ODBC drivers). After linking the tables in Access, I inspect the data contained in the linked tables. For tables that involve a number field as the primary key, the data is returned successfully. For tables that involve a character field (e.g. CHAR(3) or VARCHAR(10)) as the primary key, I have the correct number of rows returned, but the data displayed...
3
1432
by: johnsnellx | last post by:
Well, I sure could use some advice (& sympathy). In my Access program I have a small table (200 entries) linked to a main table of over 35,000 entries. While trying to enter a small amount of data into a new table (linked to the main table), I deleted the Zip code column. As you can guess, now the large table doesn't have a zip code column. SO! Can anyone pls tell me if I'm SOL on getting those ZIP Codes back(!), or, at least how can I add...
1
3929
by: musicloverlch | last post by:
I have a DB2 table and when I open it, all the records show up as #Deleted. I went here: http://www.techonthenet.com/access/tables/del_err_linked.php and tried this, but I don't get a pop-up box to choose any primary keys. The kicker is that the table works fine in Crystal Reports. What is wrong with Access? Why doesn't it work? Thanks in advance, Laura
12
13290
by: jpatchak | last post by:
Hello all, I have an annoying message popping up every time I close a form. Due to performance issues, I am caching data from a linked table on a SQL Server into a temporary local table. The user makes changes to data that are stored in the local table. Then, when the user closes the form, I run a couple of quick queries to update the data back on the server and delete any data in the temp table. After the code runs in the Close event of...
3
1485
by: Taco | last post by:
Dear forum, First, this is my first post here, so please be kind. I have been taking a look over this place for a while now and it seems like the right place to be. Alright the issue at hand: There is an Informix DB that was on a Sun system. It worked just fine. Due to issues with the server, it was moved to an IBM (AIX) system. Users access the DB through Microsoft Access, via linked tables. Every 10 rows the first record is...
2
5821
by: HotFrost | last post by:
Hello everyone, i am trying to work with linked servers... The local server is the one used by UPS worldwide software (it is Microsoft SQL Server Desktop Engine, v 8.00.2050). The linked server is 2005 MS server. on update/insert event for some table i hooked up the trigger that connects to linked server and updates the record in some DB. To test, i create a stored procedure that updates the record in UPS table that has that trigger....
2
4902
by: dieselrocks | last post by:
Hopefully someone can shed some light on this. I have a table in a DB that is linked to another DB I deleted several records in the linked table. They no longer show up in any of the tables, but when I view the form that is linked to the table, the deleted records still show.....what is going on???
0
8407
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8319
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8837
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8512
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.