|
Thanks a lot.
Absolultely corrct.
Regards
Azeem
|
|
|
|
|
Hi all,
i have a problem where i have a recordset of about 200 records containing customer names, for each record, i have to open a crystal report passing the recordset data as parameter and then exporting that report to html format (4.0)
main problem is that when i run the program it works fine for few records and then it gives an error
"Unhandled win32 exception occured in vb6.exe[7828] "
and thus terminating the program.
this error appears randomly sometimes after 15 records and other times after 50+ records.
i am attachign the code with this thread please havea look at the code and do suggest me a solution. it looks as if its related to memory management.
thanks in advance.
regards,
atin...
code
Private Sub Command1_Click()
stdt = CDate(strStDt)
seldt = CDate(strSelDt)
'rs is recordset db is connection object
rs.Open str1, db, adOpenDynamic, adLockOptimistic
Set cry = New CRAXDRT.Application
ReDim strCS(1 To rs.RecordCount)
For i = 1 To rs.RecordCount
strCS(i) = rs.Fields(0)
rs.MoveNext
Next i
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing
Set rep = cry.OpenReport("DtrList-xbndrstatement.rpt")
For i = 1 To UBound(strCS)
rep.EnableParameterPrompting = True
rep.DiscardSavedData
rep.ParameterFields.GetItemByName("seldate").AddCurrentValue seldt
rep.ParameterFields.GetItemByName("stdate").AddCurrentValue stdt
rep.ParameterFields.GetItemByName("stCus").AddCurrentValue strCS(i)
With rep
.ExportOptions.FormatType = crEFTHTML40 'exporting to html format'
.ExportOptions.DestinationType = crEDTDiskFile
.ExportOptions.HTMLFileName = "C:\" + strCS(i) + ".html"
.Export False
End With
Next i
Set rep = Nothing
cry.CanClose
Set cry = Nothing
End Sub
|
|
|
|
|
Hi,
I am trying to debug a .net 2003 windows service on a remote computer using VS2003.
I am connected to the remote pc by a VPN.
I have installed the msvcmon.exe on the remote and ran it in tcpip mode.
I am able to connect to the remote computer and service process using debug, Processes in VS2003. Using Tcpip.
But I put a breakpoint on a line and the debugging is not being hit.
Is this a futile exercise???
Should I upgrade my service to 2005 and use that debugger??
Or is it something I am missing??
Malcolm
|
|
|
|
|
hi ,
I m developing application which contain information about chemical compound. all formula of chemical compound contains superscript & subscript. I store value in database using sub & sup Tag .but crystal report does not support these tag
how can we change formula to subscript & superscript form in crystal Report as following
NH4Al(SO4)2.12H2O
Any help will be appreciated
Thanks in advance
K.mani
Software Engineer,
C-Tech Environmental Labs PVT Ltd,
Chennai(India)
By
K.mani
|
|
|
|
|
Does crystal support RichText Format? If so you could store your forumlas in Rtf or convert to Rtf.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Hi,
i want to add a comment to DataGrid cell just like in Excell i am using VB.Net 2003 thanks.
Mohammad Al Hoss
|
|
|
|
|
Here[^]
(Didnt saw the link so not sure if it helps)
|
|
|
|
|
This link is for .net 2005 and i am using 2003 but thanks for your help
Mohammad Al Hoss
|
|
|
|
|
Hi,
i have a project in which i mostly use Public Sub or Sub declaration because i am used to it. Most of those subs, could have been actually even Private Sub. Do i gain something if i change those subs(public subs or subs) and make it private sub in performance issue(for example memory)?
thanks in advance...
|
|
|
|
|
No difference in memory or performance.
This is a design issue, not a performance one.
|
|
|
|
|
No differences in performance. But if you are making everything public, you are breaking the OO rules. So only expose the needed methods/properties to the outside than exposing everything.
|
|
|
|
|
Public declaration not effect the performance but it is not a good programming to declare all variable and member declare public.
Thanx
~ Khatri Mitesh
|
|
|
|
|
Hi Friends,
In my VB 6.0 application, I am using database connection in a module. But now i need to place the connection in .ini file so whenver there is a change in connection string i can change .ini file. So pls. help me how to create .ini file for db connection and also how to call that file from my application. Please help me.
Thanks and Regards,
|
|
|
|
|
aaraaayen wrote: In my VB 6.0 application, I am using database connection in a module. But now i need to place the connection in .ini file so whenver there is a change in connection string i can change .ini file. So pls. help me how to create .ini file for db connection and also how to call that file from my application. Please help me.
IIRC, you can use API calls to read INI files from VB6.
HTH
|
|
|
|
|
|
I have a small app that extracts email addresses from the body of any mail message in a folder. That part is working fine.
I now want to extract the email addresses from any attachments also and I am having a problem opening them. (These are bounced email messages, so the real detail is in the attachment. The attachments are generally emails - no word/excel files or anything like that). I just want to get the body of the attachment as a string that I can pass to my regEx based extraction routine.
I have tried:
Private Sub ReadAttachment(ByVal theAttachment as Attachment)
Dim fs As FileStream = File.OpenRead(theAttachment.PathName)
Dim theMsg As String = fs.ToString
SaveEmailAddresses(theMsg)
End Sub
And
Dim theItem As MailItem = CType(theAttachment, MailItem)
Which both fail.
I can't find anything about opening attachments on Google - lots about saving and sending.
Any pointers on how to do this will be welcome.
Cheers.
|
|
|
|
|
After a bit more research, I have half an answer.
What I have managed to (sort of) get working is, save the attachment and then open it as a mail item.
I.E.
Try
theAttachment.SaveAsFile("c:\TempAttachment.msg")
Dim theItem As MailItem = CType(theONS.Application.CreateItemFromTemplate("C:\TempAttachment.msg"), MailItem)
Dim theMessage As String = theItem.Body.ToString
SaveEmailAddresses(theMessage)
Catch ex As InvalidCastException
Dim theFileName As String = String.Concat("c:\TempAttachment", theErrorFile, ".msg")
theAttachment.SaveAsFile(theFileName)
theErrorFile += 1
Catch ex As System.Exception
SaveEmailAddresses("Attachment@Failed.to.Open.com")
theErrorCount += 1
MsgBox(ex.ToString, MsgBoxStyle.Critical, "Error")
Finally
File.Delete("c:\TempAttachment.msg")
End Try
The problem now is that only some of the attachments are being cast as MailItems correctly. The other half throw a InvalidCastException.
As far as I can see, there is little difference between the two types of attachments. Both use the same outlook message window when opened from the saved copy. In the original email, the ones that work have the "email" icon and the ones that don't have a different icon. (Sort of a circle with some wires coming from the top right).
Any one know how I can cast these last attachements as MailItems?
|
|
|
|
|
Does anyone know if there's a painless way to get an instantaneous reading for CPU Utilization? I realise I can use a PerformanceCounter to call .RawValue but I have no idea how to convert that to anything that means anything. I don't want to have to take 2 values (ie. using .NextValue or .NextSample on the performance counter) as I know how to do this (see the example code below)
Dim myCounter As System.Diagnostics.PerformanceCounter = New _
System.Diagnostics.PerformanceCounter()
myCounter.CategoryName = "Processor"
myCounter.CounterName = "% Processor Time"
myCounter.InstanceName = "_Total"
Console.WriteLine(myCounter.NextValue().ToString())
System.Threading.Thread.Sleep(1000)
Console.WriteLine(myCounter.NextValue().ToString())
I realize that the CPU utilization value is a sampled value and *not* an instantaneous one but I'm thinking there must be a way to query whatever value Task Manager currently has - but I can't see a way of doing that?
(If you're wondering, I have a time critical app that I'd like to record a timestamp with current CPU Utilization in a log - the value doesn't have to be perfect but having a value is better than not having one.)
Thanks!
|
|
|
|
|
Well the painless solution would be to jump over the WinAPI cliff and plunge into the fiery depths of Microsoft Windows and trudge through the mountains of commands until you find the correct solution. Or you could google, or you could wait for another more useful response
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
Thanks for the answer Thomas. I wanted to trudge through the WinAPI to find something but even with googling didn't really find a good place to start. I ended up coming up with a tiny service app that runs on the computer and tracks CPU Utilization using the counter sampling then responds on a tcp port to a request for the current value. Probably overkill but it beat not having a solution
|
|
|
|
|
Hello,
I have a question timer based. It is a little bit stupid i think but i dont know how i can do it.
I have a Database SQL 2005 in that database there is the following:
ID
Website
Time
So what i need to do, i have to read from the database the first record. the Website that is in there need to be showed for the time that is also read.
After this time the next website must be showed for the next time.When the table read to the end the first record must start again.
I need to have this for showing web pages the one after the other.
I have tried to realise it with Timer function but i didnt managed it to do it.
What i did, in the first timer function i read the record , i showed the webpage.then i stoped the first timer and enabled the second timer with the correct time.After the elapsed time i disable the second timer and enabled the first timer again.
But it seems that there is no stop between the records so the last record is always showed.
I tought when i set Timer1.enabled=false that it stoped at the position is has reached and after enabled it again it wil go further but this is not correct.
Does anyone have a solution. I dont see it anymore. It is a very stupid problem i think but i dont find a solution.In older programming soft like Qbasic there was a command like Pause or wait for x seconds. But i dont find something like that in VB 2005
Thanks
DCA
didiercauberghe@hotmail.com
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim cnpresentatie As New SqlConnection(connectionstring)
Dim cmdalgemeen As New SqlCommand
cnpresentatie.Open()
Dim strQuery As String = "select * from presentatie order by id" ' order by volgorde"
Dim myCommand As New SqlCommand(strQuery, cnpresentatie)
Dim myReader As SqlDataReader = myCommand.ExecuteReader()
While (myReader.Read())
WebBrowser1.Navigate(myReader.GetString(1)) ' volgnummer = hoogste volgnummer per hotel zit op positie 13 in database
Timer2.Interval = myReader.GetValue(2) * 1000
Timer1.Enabled = False
Timer2.Enabled = True
End While
myReader.Close()
cnpresentatie.Close()
'Einde opzoeken kamernummers
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Timer2.Enabled = False
Timer1.Enabled = True
End Sub
|
|
|
|
|
Why would you need two timers? Do it with a single one...
Hou het simpel.
|
|
|
|
|
The reason i used 2 Timers is because i tought i could stop the proces, the while wend loop and so block the next record until the time was up.
Any ideas, smaal example if possible.
thanks
DCA
|
|
|
|
|
Hi,
I would use a single Windows.Forms.Timer that runs at say 1 second intervals all the time, always
enabled; plus a single variable (say Duration) that keeps the remaining time (in seconds)
for the current item.
in the Tick handler:
1. decrement Duration
2. if it becomes zero/negative:
- read the next record in the Database
- load the new item to show/play/whatever
- set Duration to its required value
That's about it.
|
|
|
|
|
Thanks. for the advice.
This is how i will try to do the thing.
Thanks
DCA
|
|
|
|