I will keep your “batch union“ idea on the back burner next time I need to do it.
[thumbsup2]
Edit - Just tried UNION ALL approach in my INSERT statement (needed to add FROM DUAL since it is Oracle)
There was a tremendous increase in performance! Thanks Duane
No, no Access linked tables.
The reason I've asked the question was - my code copying 26 000 records took about an hour. But that was over the Internet connection (I work from home with pretty fast connection). But... I also have a Virtual Machine (VM) at work, and I've tried the same code...
Yes, I can do this simplified version of the INSERT statement, but...
If I have:
Dim CnSQL As New ADODB.Connection
Dim CnOracle As New ADODB.Connection
...
CnOracle.Execute "Insert Into MyOracleTable ..."
How do I specify that part of my INSERT uses data from SQL Server?
I have 2 places with the data: SQL Server and Oracle.
I can connect to both of them, Select the SQL Server data and insert record by record into Oracle. But this is slow, too many records.
Is there a way to do:
Insert Into MyOracleTable (Field1, Field2, Field3, ...)
Values (Select FieldA...
You can use a DIR() Function to loop thru the *.txt files in the folder, read files one by one, example of how to do it here and here, and you can write into a text file
Examples are for VBA, but all that will work just fine in VB6
I would try to set up a little table:
ID Step StartDate StopDate
1 Step1 1/1/2024 8:00:00 1/1/2024 8:00:10
2 Step2 1/1/2024 8:00:10 1/1/2024 8:00:15
3 Step3 1/1/2024 8:00:15 1/1/2024 8:20:10
and chop your code into chunks where you can capture the time when you execute these...
I would suggest this approach, so you can see what's going on:
Dim strWhere As String
...
strWhere = "Division = '" & rs.Fields("Division") & "'"
Debug.Print strWhere
DoCmd.OpenReport "Evaluation Due Dates R", acViewNormal, , strWhere, acHidden
You don't need the brackets if: 1. you do not have spaces in your table/field names, and 2. you do not use reserved words for your names.
So, your SQL may simply look like:
SELECT EmployeeID, LastName, FirstName
FROM Employees ORDER BY LastName, FirstName;
Depending on where you live, it may be beneficial to you to take your computer to a place where somebody have some experience in recovering files. They should have software to do it. And it may be a lot faster, cheaper, and more reliable than doing it yourself.
And I would not focus on ‘Recycle...
By 'to go' - do you mean 'connect to B and get (Select) some records from some tables in B'?
Or 'run some code in B'? Or 'transfer records between A and B'? Or... what do you want to do?
Based on this place: How do I change default printers in VBA, you can change default printer, print, and change it back to whatever printer was there to start with:
Sub label_query_to_print(data_query_to_print, excelPath, printer_id_value, ip_address_value)
Dim prt As Printer
Debug.Print...
With your:
With ActiveDocument.MailMerge
.Destination = wdSendToPrinter
Other options for Destination are:
Name
Value
Description
wdSendToEmail
2
Send results to email recipient.
wdSendToFax
3
Send results to fax recipient.
wdSendToNewDocument
0
Send results to a new Word...
Do you mean something like this:
Sub RunBothMacros()
Call label_query_to_print(pass your attr here)
Call PrintToPrinterByIP
End Sub
or, do you want to use anything that label_query_to_print sets/gets to pass to your PrintToPrinterByIP ?
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.