|
There is one more source of problems in customer installations: they use some kind of virus scanner. And such a virus scanner might block the access database file for a moment when data are changed (because the file contents are changed). When you debug step by step, the virus scanner can finish its job before the next request is done, but in production code the time span is too small. I'd suggest to remove the database file from the virus scanners's tasks.
|
|
|
|
|
Good idea, thanks. I will talk with them about that.
------------------------------
Author of Primary ROleplaying SysTem
How do I take my coffee? Black as midnight on a moonless night.
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
I'm trying to create custom attachments to emails sent from my gmail account and linked to an access database, the attachment needs to have fields extracted from a record set inserted in bookmarks, and the process should run on the click of a vb button I can send emails with a standard attachment but I can't figure out how to customise the attachments could someone point me in the direction of a soultion
|
|
|
|
|
Member 9865508 wrote: I can send emails with a standard attachment Good. Can you show us that code?
Member 9865508 wrote: but I can't figure out how to customise the attachments That'll depend on their format. A textfile is easily manipulated. Did I understand it correctly that you want to use "emails" as an attachment, and customize those? You can open those (save as *.eml) in notepad, and you can replace tags just as with any text-file.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
what i'm trying to do is send emails from vb that have a custom attachment based on the fields in an access database each email is sent to a different person and the attachment will be different for each person, the code i'm using so far is
Set cdomsg = CreateObject("CDO.message")
With cdomsg.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = 465
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "xxx"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xxx"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Update
End With
If Not (r.EOF And r.BOF) Then
r.MoveFirst
Do Until r.EOF = True
email = r.Fields("EmailAddress")
name = r.Fields("Firstname")
With cdomsg
.To = email
.FROM = "I@dontThinkThisIsUsed.com"
.Subject = "Test email " + name
.TextBody = "message"
.Addattachment "attachment loaction.docx"
.Send
End With
r.MoveNext
Loop
hope this helps thanks
I can send the emails but not the custom attachments
|
|
|
|
|
Member 9865508 wrote: I can send the emails but not the custom attachments
For that you'll have to modify the documents before sending. Am I looking at VBA or VB6? Either way, both aren't really suited to modify docx-files. I suggest you move to VB.NET, and write a small console-application that can display the contents of a docx-file.
If you can display it, you can change it.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Unfortunatly not really an option and it needs to be automated otherwise it sort of defeats the purpose,I have found code that can create a mail merge and with a few major modifications can save the mail merge as seperate documents which could then be attached to the individual message but it is messy and not really sure if it will even work, just wondering if anyone has actually tried this before.
|
|
|
|
|
Member 9865508 wrote: Unfortunatly not really an option Trying this in VBA or VB6 will be more challenging.
Member 9865508 wrote: just wondering if anyone has actually tried this before.
In a programming language; yes. It'd also be doable from VBA if it were a text-file, but manipulating a .docx-file will be a fair bit harder.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I have date:
Start= 2013-18-03 09:00:00 AM
End = 2013-19-03 03:00:00 PM
What if the day is calculated starting from 12:00:00 PM?
i try this code:
Dim start As DateTime
Dim enday As DateTime
start = "03/18/2013 09:00:00 AM"
enday = "03/19/2013 03:00:00 PM"
Dim span As TimeSpan
span = enday.Subtract(start)
MsgBox(span)
but the result is 1 day, it should be 3 days. Could you give me the suggestion?
modified 18-Mar-13 10:44am.
|
|
|
|
|
Akbarblack wrote: start = "03/18/2013 09:00:00 AM"
enday = "03/19/2013 03:00:00 PM"
I have a question which is - how can the difference between the 19th of March and the 18th of March possibly be three days irrespective of when the day starts?
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
|
Not the most elegant solution I've ever come up with, but off the cuff this should do it...
Dim dt1 As DateTime = "1/1/2013 9:00 AM"
Dim dt2 As DateTime = "1/2/2013 12:00 PM"
Dim days As Integer = 0
days += (dt2 - dt1).Days
If dt1.Hour < 12 Then
days += 1
End If
If dt2.Hour >= 12 Then
days += 1
End If
|
|
|
|
|
|
I'm having a bunch of boolean properties that's going to be stored in bytes in a file.
I'm not having any problems doing it, (adding multiples of two), I just wonder if there is any best practice?
"The ones who care enough to do it right care too much to compromise."
Matthew Faithfull
|
|
|
|
|
|
Bitvector32 looks interesting, I'll have a look at it tomorrow when I have gotten some sleep.
"The ones who care enough to do it right care too much to compromise."
Matthew Faithfull
|
|
|
|
|
where I found tutorial about direct x9 sprite
|
|
|
|
|
Have you heard of Google[^]?
Use the best guess
|
|
|
|
|
|
|
It was a perfectly reasonable answer to the question. He asked "Where can I find...", so a search engine is a reasonable answer. If the OP types his exact question into Google, he shall find examples.
|
|
|
|
|
I have spent a lot of time trying to find either a free or low cost ($10's) multiple column combobox or list box for visual basic.
I feel I am going to have to bite the bullit and build one from scratch in C++, but before I do that. Has anyone any idea why the version in vba (access and excel) has never been ported across to VB.
In fact does anyone know if the source code for these exist anywhere where it can be reused.
I feel this is a real lack in visual studio 2012, as there are other development languages and IDE that give you this functionality for a lost less $'s
|
|
|
|
|
A multi-column combo box does not really make sense. For lists you have the ListView Class[^].
Use the best guess
|
|
|
|
|
I understand what you say about the listview, but for a simple way to bind a data source via a bindingsource to a simple dropdown control where you select the binding source and columns to display and a member to be used a value member.
I can understand it would a big job if these components did not already exist, espically in a lesser powerful products
|
|
|
|
|
Simple drop down controls are specifically designed to use only a single column. If you want something that does not currently exist you need to extend an existing control, or write a new one.
Use the best guess
|
|
|
|