Or try defining the ID column as an auto-incrementing field. You'll lose the sequence of the numbers, but you'll maintain uniqueness. Then you could use something like a timestamp field to determine the order in which records were added. That is:
Start a transaction
Add a new record - the...
Thanks for the reply. Problem is I get an 'object required' error when I try to use it like I do below:
Printer.Duplex = 2
ActiveWorkbook.PrintOut Copies:=1, Collate:=True
/Cy
Thanx! Your explanation makes sense. VB's poor handling of sequential files doesn't. Oh well - someday I guess we'll all create relational databases for even the simplest little sequential process... >:-<
...and record layouts when processing sequential files. Why can't I define a record type in VB like:
Type MyRecordLayout
RecordID as String * 6
FirstName as String * 20
etc, etc
End Type
Dim InputRcd as MyRecordLayout
Line Input #1 InputRcd
What I mean is of course I can DECLARE the...
I'm writing a little snippet of code to print all Excel sheets in a folder - could be something like 30 sheets at a time. I've got a printer that's duplex capable - the problem is I can't figure out how to get that mother to actually print on both sides from within the code.
I've seen...
I have a large SQL Server database that I access via MS Access. What I'd like to do is execute a stored procedure, passing parameters from a user form. Kinda like:
PARAMETERS Forms!Main!fromdate DateTime, forms!main!todate DateTime;
EXEC sp_Total_Time_For_Period...
Thanks a lot, reidfl. Very helpful. :-( Now, if there's anybody out there who knows how to retrieve a TEXT field from SQL Server into a textbox, I'd be very grateful...
I'm trying to retrieve a field of the type 'TEXT' from an SQL server database and can't figure out how to do it. I've written a syntactically correct stored procedure that I can execute and get the text in Query Analyzer, but it won't return any records in VB, and if I try to open a recordset...
I have a number of apps that can run unattended (in theory) - they collect statistics from other systems and produce reports, among other things. I also have an app that runs once an hour to generate fresh statistics for a customer accessible web site. There are a number of things that can go...
Hi again!
I tried almost that - I used ExitProcess instead, and it does seem to do the trick. I'm worried about what's left in memory, though - does that function unload all forms and modules read into memory, for instance? (If you're interested in what batch scheduler I'm using, by the way...
The whole picture is this:
I wish to run a sequence of programs in batch mode - producing reports, aggregating data and so forth. Some of these programs are dependent on the successful execution of a previous one. So let's say program 1:s task is to establish contact with a remote server and...
Hi!
I tried setting different return codes in my VB app (so I can take appropriate actions when/if it fails), and I tried using the SetLastError function, but the app still seems to return 0, regardless of what happens... Clues, anyone?
/Cy
We just installed a Batch job queue system which among other things can act one way or the other based on an app's return code. Return codes are common in the mainframe world, but how do I issue a return code from inside a VB app?
Cy
Here's something that may work for ya...
DBEngine.SystemDB = SysDB$
DBEngine.DefaultPassword = Pwd$
DBEngine.DefaultUser = User$
On Error GoTo GetPswd
Set AktuellDB = OpenDatabase(DatabaseName$)
Exit Function
GetPswd:
If ctr% = 0 Then
ctr% = 1...
Check out the sample apps that were delivered with VB (prjmapi.vbp). You ought to have no problem whatsoever to find the right place to stuff your code. Another solution, if your users use Outlook, is to make a rule...
/Cy
I too need to run reports from VB, but I've got another twist to the... challenge. The app in question WAS running as an Access application, checking a database table every ten minutes for new records. Upon existence of such records, the app either a: ran a report which it faxed to the...
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.