Avatar billede tma_oksboel Nybegynder
21. juni 2002 - 12:22 Der er 9 kommentarer og
1 løsning

outputto - Output formater er væk??

Hej
Access XP, filformat Access 2000. XP-Platform

Jeg har på et tidspunkt lavet en makro som skriver en forespørgsel til en rtf-fil via metoden OutputTo.
Nu for jeg en fejl fordi der i forbindelse med makroen er tomt under filtyper. Windows siger at jeg skal rette problemet i registreringsdatabasen. Jeg har prøvet at oprette en ny database, heri virker makroen fint. Derefter prøvede jeg at importere alle objekter til en ny database, men så virker makroen ikke. Der er bygget sikkerhed ind i databasen, derfor er eneste fællesnævner den mdw-fil som de benytter.
Er der nogen der har oplevet noget lignende og har et svar?

Torben
Avatar billede terry Ekspert
21. juni 2002 - 12:43 #1
If you are using security then I dont think you can just import objects into a new dB it giving problems! Both the MDB and the MDW file hold information concerning security and if you copy object to another dB I DO NOT think that any security infromation is copied. But then it depends on a number of things!
Avatar billede tma_oksboel Nybegynder
21. juni 2002 - 12:50 #2
Im only trying to export the result of a query. I need the data to be able to merge (brevflette) in MS Word. Is there any easer way, that I could use?

Torben
Avatar billede terry Ekspert
21. juni 2002 - 12:59 #3
you could try

DoCmd.OutputTo acOutputQuery, "YourQuery", acFormatRTF, "C:\TheFile.rtf", True
True at the end opens the file in Word if you change this to False then it doesnt
Avatar billede tma_oksboel Nybegynder
21. juni 2002 - 20:00 #4
I already tryed to do it in code. It has the same effect.

Torben
Avatar billede terry Ekspert
21. juni 2002 - 20:12 #5
Torben>as I mentioned, I VERY MUCH DOUBT that you can import objects from a secure database into a none secure database! I  am sur ethat IF you create the macro manually then it will work but because there is security on the database you are importing from then it isnt allowing you to, which in my mind is correct!
Avatar billede itbjarne Nybegynder
22. juni 2002 - 19:47 #6
Giv brugeren admin fulde rettigheder i den db du eksporterer fra, og importer i den nye db under samme bruger, så mener jeg at man kan være sikker på at eksport/import skulle være ok.
Avatar billede tma_oksboel Nybegynder
23. juni 2002 - 11:43 #7
To terry: Maybe I wasn´t precise enough. I am not trying to import from a database. I have created the macro in the database (I am the owner of it). I have logged on to the system (Windows XP, no server just a stand-alone pc). I have administrators rights to the computer. The reson why I tryed from a non-secure database was only to see if there was a difference.
The problem is, that if I, in Word, try mail-merge (brevfletning) to a query, I am promted for a password to the database, because the computer opens a new session to the database. Therefore I wanted to export the result of the query to a RTF-file, which then could be used as a datasource for the mailmerge.  Could a make the mail-merge more efficient in another way?

Torben
Avatar billede terry Ekspert
23. juni 2002 - 11:59 #8
Hi
I'm a bit puzzled! In your last comment (11:43:00) you say "Could a make the mail-merge more efficient in another way?" Are you saying that the ORIGINAL QUESTION is no longer a problem and that you only want to make the macro more efficient in the secure (original) database?

I dont know much about Word OR mailmerge, but I am sure that you should be able to make a connection to the Access database (from Word) and give the loggin necessary. This will in my oppinion be the best solution, it would save you having to export to an RTF file.

If you problem STILL is because you CAN NOT get it to work in the copy (non secure) database then I suggest that you create the macro and all the other objects BY HAND, do NOT import them from the secure database. Then see if it works and IF it does then it IS because you CAN NOT copy objects from a secure dB into a non secure dB without consequences!
Avatar billede tma_oksboel Nybegynder
23. juni 2002 - 15:39 #9
I will try to make the mailmerge from word to the secure database, and supply the nessesary login information. I dont now if it will work.

Thank you for your time

Torben
Avatar billede terry Ekspert
23. juni 2002 - 15:45 #10
Hope it does, and thanks!
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