I have some vbscript for copying a file - it works fine when I double-click it. However, if I try to put it under control of the Scheduled Tasks (in Windows 2000) - the task runs indefinitely (and is never successful).
I've tried recoding the vbscript (as a shell call and using .CopyFile). Same...
It was messed up around the 'go's I removed those and placed all the syntax on one line, it ran through fine and created the job. In fact all I wanted to do was run an existing job (so it was much easier then I thought :)
Thanks.
I'm executing it through a bat file command:
ISQL -u <user> -P <password> -d <Database> -i <the script above> -o <the log file above>
It appears I can log on OK, but I see the syntax errors. Unfortunately I can't use QA to execute it (it has to be done from a Virtual PC without SQL Server...
Thanks very much - that first excellent link did the trick. I used ReadBinaryFile(cFileToSearch) to read it and RSBinaryToString(xBinary) to convert to a string. It's fast (5 seconds).
The idea of searching by line is a good one - and in fact all I'm interested in is whether the string occurs (not how many times). I've done that and it works fine - the problem comes if the file is binary (I then get the message "Input past end of file"). Big text files are fine...
It was taking about 3-4 minutes to find 3 occurences in a 1,230 KB file, which did not compare with a UNIX grep at all well! I've not tried the Instr() approach.
I'm using this code to find a string in a file. It works fine as long as the file is NOT a large binary file!! Unfortunately that's exactly what I want to look in. Any ideas what the problem might be/solution.
Thanks in anticipation.
Option Explicit
Dim objRegExpr
Dim FSO, TF, inp
Dim...
This is just an example, the following code moves through the table called tbl and uses the field TABLE_NAME to step through each table's name (linking them to the database). You could adapt this as the key bit is the loop.
Private Sub Command0_Click()
Dim db As DAO.Database
Dim rsTable As...
Remove duplicates from a table TEST.
Step1:
SELECT DISTINCT Tests.* INTO Tests_1
FROM Tests;
Step2:
DELETE Tests.*
FROM Tests;
Step3:
INSERT INTO Tests
SELECT Tests_1.*
FROM Tests_1;
Then get rid of the temp table tests_1:
DoCmd.DeleteObject acTable, "tests_1"
I found WinZip's command line extension quite useful (then you're not limited to 8 char names):
Dim myObjFSO
Set myObjFSO = CreateObject("scripting.filesystemobject")
CheckFolder "C:\source"
Sub CheckFolder(strPath)
Dim objFolder
Dim objFile
Dim objSubdirs...
Outline on how you might do with a simple example, Table1.
You can use an ID in your table (an autonumber field):
Table1 is:
ID Field1
1 10
2 2
3 4
4 1
5 8
You can create a query that does this:
SELECT [ID]+1 AS Expr1, Table1.Field1
FROM Table1;
You can then create a join between your...
Please could anyone tell me how I can show the table that's currently being processed in the loop below. I'm trying to use a pop up form to show the name of the table being linked - only the pop up only gets the focus after the loop's done.
Thanks.
Private Sub Command0_Click()
'now do the...
If I use code it works fine though - strange:
Dim db As DAO.Database
Dim rsTable As DAO.Recordset
Set db = CurrentDb
Set rsTable = db.OpenRecordset("tbl")
rsTable.MoveFirst
Do While Not rsTable.EOF
DoCmd.TransferDatabase acLink, "ODBC"...
...However it executes twice - in fact it sometimes produces up to 4 instances of the tables! There's a lot of tables - so I use a Like "ACC*" to select all the ACC* tables.
Can't see why.
Any thoughts appreciated - may not be the best way to do this, but you'd think it would work.
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.