If you can't load the document into a table, and the text file is too big to load into memory, you could also use the Binary form of Line Input. You can then move anywhere in the file, but you will have to find end-of-line markers (vbCrLf) using instr(), etc.
Something like this:
Public...
It's possible, you just have to open another thread to do it. Here's one way:
Dim strDOScmd As String
strDOScmd = "COPY " & Chr(34) & CurrentDb.Name & Chr(34) & " " & Chr(34) & "C:\DESTINATION_PATH\Test.mdb" & Chr(34)
Shell "C:\Windows\System32\Cmd.exe /C " & strDOScmd, vbHide ' Use...
I'd have bet money you were wrong saying that code doesn't work. Of course, you were correct! It won't let you do that.
Drop the following code into a Module. It WILL work.
Function BackMeUp()
Dim SourceFile, DestinationFile
Dim DB As Database
Dim CHNL As Integer
Set DB = Currentdb...
I use this code module, which is modified from a MS KB article. Hands-free.
Option Compare Database
Option Explicit
'Version 1.1(1)
'From Access '97 KB Article Q159328
'REQUIRES: LibCommonFunctions, LibFileFunctions,
' Reference to Microsoft Word 8.0 Object Library (MSWord8.olb)
'...
Public Function DisableAllControls(ByRef iForm As Form, Optional ByVal iExcludeControl As String) As Boolean
Dim Ctl As Control
On Error Resume Next
For Each Ctl In iForm.Controls
If Ctl.Name <> iExcludeControl Then
Ctl.Enabled = False
End If
Next 'Ctl
DoEvents
End Function
It should always be available in Windows 2000 Pro and Windows XP (unless the service has been disabled). It's loaded when you upgrade Internet Explorer to 5.5 or 6.
If you are running Windows 95, you can download Windows Script Host 5.6 from the Microsoft Windows Script Technologies Web site...
You could use the ShellExecute API call to avoid the batch file, but it's really no more efficient.
1) Old_App Startup sees a new version, copies it to local PC with a different name.
2) Old_App Uses Shell_Execute to run New_App, then immediately shuts down.
3) New_App looks at its own name...
I've just finished researching this topic. Here's the links I came up with:
'### SOURCES: www.freeaccess.de/downloaddetails.asp?id=19 'Example in MailDBNeu.mdb
'### www.AllAPI.net 'API Descriptions for wsock32.dll
'### www.granite.ab.ca/access/email.htm 'Tony...
You should be able to paste this code into a text file, then rename the text file to have a .vbs extension, then double-click the file's icon to run it. If it worked, you'll get a message box saying "This VB Script has repaired the damage done".
I have a similar App. I checked to see if I have the same problem, and I probably do, but it doesn't show because I prompt for the printer before doing the mailmerge, and immediately print the merged document (the user doesn't have to do any editing of the merged document, so I can print it...
I don't think you can trap a keystroke in VBScript (by definition, the only inputs you have to the script are MsgBox and InputBox. I assume you don't want a box to popup every minute saying "Continue (Y/N)?").
You could invoke a pause by reading from an object that has this feature...
You probably need a reference set for Microsoft Access.
Go into (and I'm guessing VB6 here) Project>References and choose 'Microsoft Access x.0 library' (x will be a number representing your current version of Access).
Incidentally, both your PC and the PC(s) you run the program on will have to...
Assuming you don't have MS-Word ;)
Reading from the Clipboard:
There's a clipboard object in Internet Explorer that should be usable. Something like:
Set oHtml = CreateObject("htmlfile")
sClipText = oHtml.ParentWindow.ClipboardData.GetData("text")
WScript.Echo sClipText...
This happens for several reasons.
The most common are those your help desk folks gave, i.e., somebody is not leaving MS-Access in a controlled manner. This includes flipping the power switch of your PC without exiting Access, and/or exiting a remote session (using Terminal Server or Citrix)...
Assuming that there's always 2 lines, you would not perform an rs.Update after setting the first line's fields. Move the 'rs.Update' statement to just before the 'FirstLine=False' statement. (In other words, leave the new record un-updated until you've done a line input of the second line, and...
Definitely achievable. You code should look something like this:
Dim CHNL As Integer
Dim FirstLineRead as Boolean
'Read Input File, convert the data to an Access Table
CHNL = FreeFile
Open iPathAndFileName For Input As #CHNL
Line Input #CHNL, str
Do
str=trim(str)...
'Access.References'
My bad. OK, to get a handle on that you'll have to use automation to open another copy of Access, something like:
Dim AccApp As Access.Application
Set AccApp = CreateObject("Access.Application.8")
AccApp.OpenCurrentDatabase FilenameAndPath$
then you'll...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.