Avatar billede nyholm Novice
11. september 2005 - 10:32 Der er 10 kommentarer og
1 løsning

Dølja visning av tabell.

Vid import av data till tabell vill jag bara visa den/de tabeller som import kan ske till. I en vanlig db ær det enkelt genom att i egenskaper markera øvriga tabeller som dolda. Har jag dæremot delat upp db:n i frontend/backend så hjælper det inte om øvriga tabeller ær markerade som dolda i båda. Vid import visas alla lænkade tabeller, oavsett om de ær markerade dolda eller ej. Finns det en løsning før detta?
Avatar billede claesdamlund Nybegynder
11. september 2005 - 13:13 #1
Hvis du navngiver dine tabeller med USys i begyndelsen, f.eks. USysPerson, opfattes de som systemtabeller og er dermed skjult. Også i dit tilfælde. Om dét er en brugbar løsning for dig ved jeg ikke?
Avatar billede nyholm Novice
11. september 2005 - 14:19 #2
Tack før svaret! Jag har testat din løsning men det hjælpte inte. Vid import till befintlig tabell, visas alla icke dolda tabeller i frontend och samtliga i backend, æven om det markerats att dolda objekt och systemfiler inte skall visas och tabllerna namngivits med Usys"Tabellnamn". Det ær viktigt før mig att finna en løsning då annan anvændare skall bruka databasen och jag vill att endast de tabellerna skall visas som import skall ske till.
Avatar billede terry Ekspert
11. september 2005 - 15:40 #3
Sorry, but I dont quite understand your question, any chance of getting it translated to English?
Avatar billede terry Ekspert
11. september 2005 - 15:43 #4
I get this part
"Vid import av data till tabell vill jag bara visa den/de tabeller som import kan ske till."

Can you not make your own import routine?
Have a table which contains the allowed "destination" tables. But in the end, only tables with the same layout as the data you want to import are of any use.
Avatar billede nyholm Novice
12. september 2005 - 10:01 #5
Hi Terry!
I know that import of data can only be done to a table that contain the right recordset for the imported data. However, in my db I have 14 tables and only 3 of them are tables that the user want to import data to. In order to make the import esier I only want the 3 possible tables to appear in the import dialog.
You asked if I can make my own import routine. Maybe this is the best solution.
Can You give me an example of how this can be done?
Avatar billede terry Ekspert
12. september 2005 - 13:59 #6
Hi
When you run the import wizard it is possible to save the import specification which can be used later. You can also use it if you use code to make the import.

Lets say you save the import specification with the name "MyImportSpec". And in a table you have (for example) the table names which you can import to.
You can then add a combo box to a form which contains these tables names. Now you add a button to the form which runs the following code. You could also use a file open dialog to choose which file to import.

Docmd.TransferText acImportDelim, "MyImportSpec", Me.ComboContainingImportTables ,"C:\Test.txt"
Avatar billede nyholm Novice
12. september 2005 - 18:17 #7
Hi Terry!
Your solotion seems te be the way to go, but I can´t get it to work.
During the normal import dialog I chosed to save the import specification and named it "Resapost Importspecification". I did as You explained with a combobox in a form that lists the posible tables to import to. The name of the combobox is "Importtables". I have a botton in the form which runs the following code: DoCmd.TransferText acImportDelim, "Resapost Importspecifikation", Me.ImportTables, "C:\resapost200504_15364". When it runs the code I get the error message 3051 The file could not be opened. The files name and path is correct. What is wrong and what do I write insted of the path to the file to import, if I want to use the open file dialog?
Avatar billede terry Ekspert
12. september 2005 - 19:25 #8
Hi
You can download an example of using the Open file Dialog here. (Other examples too)

http://www.nyholm.dk/makeiteasy/Home.asp?ContentID=30&MenuItemID=25

Try changing the file name to .txt or maybe even .csv
Avatar billede nyholm Novice
13. september 2005 - 10:18 #9
Hi Terry!
I have now solved it, thanks to You. I combined Your solotion with parts from a MakeItEasy solotion and it works just greate! Thank's again!
I have accept Your answer, but how do I transfer Your points?
Avatar billede terry Ekspert
13. september 2005 - 10:44 #10
great to hear its up and running :o)

I think you need to select my name in the list and then accept.
Avatar billede terry Ekspert
13. september 2005 - 12:04 #11
thanks nyholm, have a nice day
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester