Avatar billede daiz Nybegynder
07. november 2003 - 12:10 Der er 12 kommentarer og
1 løsning

SQl fra "dos"

Jeg kunne rigtige godt bruge en mulighed for at kalde en eksekverbarfil i dos-promt hvor jeg kan smide sql streng med og få opdateret min access db .... findes det ... jeg har luret lidt omkring i access, men kan ikke finde noget
Avatar billede ldanielsen Nybegynder
07. november 2003 - 12:11 #1
Kan du ikke afvikle en *.vbs fil fra en prompt?
Avatar billede daiz Nybegynder
07. november 2003 - 12:19 #2
jeg kender ikke noget til vbs, men det mener jeg faktisk man kan ... hvis ikke der er nogen andre svar kan jeg jo oprette en opgave i programmering kategorien :) ...jeg håber dog på at der finde noget der kan!
Avatar billede ldanielsen Nybegynder
07. november 2003 - 12:24 #3
vbs = Visual Basic Script

Du skal bruge ADO til at kontakte databasen.
Hvis du ikke kan VBScript, så bliver det nok lidt langhåret.

Det der skal gøres, kan det skrive i selve databasen, som en Opdateringsforespørgsel?
Avatar billede ldanielsen Nybegynder
07. november 2003 - 12:24 #4
kan det skrives i selve databasen .. Sorry
Avatar billede fynbohans Nybegynder
07. november 2003 - 12:46 #5
Forstår ikke helt hvad det er du mener. Vil du køre et program fra
kommandolinjen og hvad er det for et program?
Hvis du vil køre et program kan du bl.a. bruge SHELL.
Avatar billede terry Ekspert
07. november 2003 - 18:02 #6
Could you give some more information so that we can maybe make some suggestions?
Avatar billede daiz Nybegynder
23. november 2003 - 16:54 #7
Det jeg søger er fx .... C:\>...\databasefil /swl SELECT * FROM, som skal resultere i en liste med records i promten
Avatar billede fynbohans Nybegynder
23. november 2003 - 17:37 #8
Forstår stadig ikke hvad du mener.
Er det f.eks.posterne i en tabel du vil skreve ud fra kommmandolinjen?
I så fald kan det kun gøres inde fra Access.
Avatar billede terry Ekspert
23. november 2003 - 18:24 #9
These are the commnad line options you can use with Access. Take note of the /cmd parameter which you may be able to make use of. If not then it isnt possible.


Startup command-line options
The following table lists the Microsoft Access command-line options.

Option Effect
database  Opens the specified Microsoft Access database or Microsoft Access project. Include a path if necessary. If you are running Microsoft Windows 95, the default path is your My Documents folder.
/excl Opens the specified Access database for exclusive access. To open the database for shared access in a multiuser environment, omit this option. Applies to Access databases only.
/ro Opens the specified Access database or Access project for read-only access.
/user user name Starts Access by using the specified user name. Applies to Access databases only.
/pwd password Starts Access by using the specified password. Applies to Access databases only.
/profile user profile Starts Access by using the options in the specified user profile instead of the standard Windows Registry settings created when you installed Microsoft Access. This replaces the /ini option used in versions of Microsoft Access prior to Access 97 to specify an initialization file. 
/compact target database or target Access project Compacts and repairs the Access database, or compacts the Access project that was specified before the /compact option, and then closes Access. If you omit a target file name following the /compact option, the file is compacted to the original name and folder. To compact to a different name, specify a target file. If you don't include a path in target database or target Access project, the target file is created in your My Documents folder by default.
In an Access project, this option compacts the Access project (.adp) file but not the Microsoft SQL Server database.

/repair Repairs the Access database that was specified before the /repair option, and then closes Microsoft Access. In Microsoft Access 2000 or later, compact and repair functionality is combined under /compact. The /repair option is supported for backward compatibility. 
/convert target database Converts a previous-version Access database or Access project to the default file format, renames the new file, and then closes Access. You must specify the source database before you use the /convert option. To view the default file format, click Options on the Tools menu, and then click the Advanced tab.
/x macro Starts Access and runs the specified macro. Another way to run a macro when you open a database is to use an AutoExec macro.
/cmd Specifies that what follows on the command line is the value that will be returned by the Command function. This option must be the last option on the command line. You can use a semicolon (;) as an alternative to /cmd.
Use this option to specify a command-line argument that can be used in Visual Basic code.

/nostartup Starts Access without displaying the task pane (the second dialog box that you see when you start Access).
/wrkgrp workgroup
information file Starts Access by using the specified workgroup information file. Applies to Access databases only.

Notes
To run a Visual Basic for Applications procedure when you open a database, use the RunCode action in the AutoExec macro or in the macro that you run by using the command-line option /x. You can also run a Visual Basic procedure when you open a database by creating a form with a Visual Basic procedure defined for its OnOpen event. Designate this form as the startup form by right-clicking the Database window, clicking Startup, and then entering that form in the Display Form/Page box.
To specify a forward slash (/) or semicolon (;) on the command line, type the character twice. For example, to specify the password ;mjs/md on the command line, type ;;mjs//md following the /pwd command-line option.
Avatar billede daiz Nybegynder
09. december 2003 - 08:48 #10
Det var mest for at opdatere tabeller ved brug af "UPDATE", jeg tror bare jeg vil lave noget i vbs så, terry, hvor har du fundet det ovenstående ?
Avatar billede terry Ekspert
09. december 2003 - 18:04 #11
Access help :o)
Avatar billede daiz Nybegynder
14. december 2003 - 20:30 #12
ok mange tak
Avatar billede terry Ekspert
14. december 2003 - 20:31 #13
selv tak :o)
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