|
|
|
|
||
OSQL Interface to MSDEThis is a simple graphical interface you can use to send T-SQL commands to MSDE from an Access database. It's written in Access 97 but should convert easily to its more recent siblings. Download the project MSDEFromACC.zip (24 kB) here. All the necessary code is behind the form. It's no replacement for the fancy interfaces that come with the full NT-version, but it stops the results going off the page in the plain DOS version. MSDE must be running on your local machine and it assumes user sa with no password. The screen dumps following show:
|
|
The program works by creating the OSQL DOS command from your input, calling it from the DOS shell, and then reading in the results from the output file. It uses two temporary text files, ~SqlIn.txt and ~SqlOut.txt, and attempts to clean up some of the extraneous characters that OSQL produces before displaying the results. The key instructions are: ' Create a command string to call OSQL sCommand = "OSQL /Usa /P /n /w 80 /i " & msInFile & " /o " & msOutFile ' Is a database specified? If Len(Me.txtDatabase & "") > 0 Then sCommand = sCommand & " /d " & Me.txtDatabase End If ' Delete the output file If Len(Dir(msOutFile)) > 0 Then Kill msOutFile End If ' Execute DOS command that outputs text to OutFile varRet = Shell(sCommand) Originally, I'd tried to use the Rich Text control. It made some things easier, but made
distributing the project the usual nightmare you have with Active-X controls. Also, whenever
I tried to enter a command with an asterisk in it, such as For more information Contact
DI Management.
Return to the SQL/MSDE Page.
[Top] |
| Copyright © 2002 DI Management Services Pty Limited ABN 78 083 210 584 Sydney, Australia. www.di-mgt.com.au. All rights reserved. |
|
Home | What We Do | Services | Our Approach | About Us | Projects | Tips | Links | Cryptography | CryptoSys API | About This Site | Contact | Email Us |