|
Uttam Kumar,
You cannot do this in native VB6 functionality. However, there are some OCX's out on the Internet that will allow you to do this relatively easily.
Good Luck,
Tony
|
|
|
|
|
Hi,
I need to implement "Back" and "Forward" button functionality (as seen in browser) in my application.
I have general idea about how to implement it(using either stacks or an array) but am wondering if there is any article or code snippet which shows how do it.
Any help is appreciated.
Thanks.
Vidvan
|
|
|
|
|
What are you working with, could you be a little more explicit?
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
I am using VB.Net to write an application which can automatically send an email. I don't want to restrict my program by usign Outlook only. Is there any other way to send an email, say through an mail server??
Any help or pointers is greatly appreciated!
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
I am having a problem in vb 6 in trying to access the content of recordsets which store the results of a query. When I try to pull the value out of the recordset as in dim value = rs!key, I get an error saying that the recordset is empty (I test the BOF and EOF and I get both to be true for the rs), - (the code crashes and gives this error at rs.MoveFirst), however when i click on debug and go into the code, the rs fills and the code continues to the end successfully. I am also getting this problem in a different context where in trying to insert records into a table, recordsets are updating and reading too slowly so old values are being inserted into tables generating errors. I only get these errors when I run the code, but If i step through I get NO errors! Please help!
|
|
|
|
|
If rs.BOF AND rs.EOF are both true then the rs is either nothing or empty. In which case don't let your code use the rs.
Sounds like the underlying db has just been populated and you are attempting to get records from it before the db has finished updating itself i.e. after data has been sent to it. Are you using Access by any chance? Try putting a wait in your code after the db has been populated.
|
|
|
|
|
|
Yes I am using an Access Db. Could you give me an example of using the wait code for recordsets or after the db has been populated? I was looking on the net and could not find anything! Thanks so much for your help! Looking forward to your response!
|
|
|
|
|
The correct solution to your problem would be to open an asyncronous connection and then when you have written your data to the db wait until the connection has finished executing the SQL command.
Use the ADO const dbRunAsync when opening the connection to get an asyncronous connection. Then write the data to the db, and wait by using a loop such as:
Do While Con.StillExecuting<br />
...<br />
Loop
When the loop exits the db has been updated and you can then retrieve the required data.
HTH
|
|
|
|
|
I am attempting to connect to an Access Database with not much data and am using MDAC version 2.70.7713.4...I have worked around the problem. I noticed that the record I was querying for and then using movefirst to retrieve, was added immediately prior to performing the query for the value associated with the record added.
Before:
'If record did not exist then add record
Dim rs As New ADODB.Recordset
SQL = "TableName"
rs.Open SQL, dbMasterConn, adOpenKeyset, adLockOptimistic, adCmdTable
rs.Addnew
rs!code = varCode
rs.Update
'Following this a rs was filled for generic instances where record did or did not exist for the record just added. Record was only added if it did not exist but the code is needed regardless of whether record did or did not exist
Dim rs As New ADODB.RecordSet
rs.Source = "SELECT code FROM TableName where condition"
rs.CursorType = adOpenForwardOnly
rs.ActiveConnection = dbMaster
rs.Open
rs.MoveFirst <--it stuck here
CodeNeded = rs!code
After changes:
'If record did not exist then
Dim rs As New ADODB.Recordset
rs.ActiveConnection = MasterDb
SQL = "TableName"
rs.Open SQL, , adOpenKeyset, adLockOptimistic, adCmdTable
rs.Addnew
rs!code = varCode
rs.Update
CodeNeeded = varCode
else(if record already exists)
Dim rs As New ADODB.RecordSet
rs.Source = "SELECT code FROM TableName where condition"
rs.CursorType = adOpenForwardOnly
rs.ActiveConnection = dbMaster
rs.Open
rs.MoveFirst <--no longer stuck here and ran.
CodeNeded = rs!code
A very good detailed link that helped with making connections, creating recordsets, reading and adding values to recordsets etc for both DAO and ADO was:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acchap2.asp
|
|
|
|
|
Hi!
I've a .exe program writen in ANSI C that returns the real hard drive serial member.
From VB i'm calling it doing like:
MyApp = Shell("Diskid32.exe", 0), but Shell function returns a Variant (Double) representing the program's task ID if successful, otherwise it returns zero, but not the programs output!
Can anyone help me with this?
Thank you for your time
|
|
|
|
|
|
Thank you for answering but what i need is the manufacturer serial number not the volume's!
If i know a way of doing it with VB please tell me!
|
|
|
|
|
|
Well, I found the source for the utility your using. It's at http://www.codeguru.com/system/DiskId32.shtml. The only problem is, your going to have to recode it to be directly usable in VB, possibly as a DLL.
The easier way to do it is to pipe the output from the program to a text file with something like: MyApp = Shell("Diskid32.exe > log.txt", 0) You might have to use another method to get this to launch properly. But, in any case, what your going to have to do is open the log.txt file and parse it up to pull the information out of it.
It's better than writing a custom DLL to do the job...
|
|
|
|
|
Thank you all!
What i did was: I edited the c++ code to write the hard drive serial number to a file, that is imediatilly read and erased from the vb code, its not the best solution but i guess it shall work...
Thank you once more
|
|
|
|
|
Does anyone have or know where I can get hold of a ListView control which can be used in VB6 with the capability of multi-line ColHeading's?
If not I will see about creating my own, in C++ for use in VB6.
|
|
|
|
|
previously, when generating reports, I entered a range of dates by means 2 textboxes. However, for the purposes of validation, i found this an inadequate way (eg it allows entry of days > 31 etc). instead i have started to use an MaskEdBox, i have set the DataFormat to Date, how do i set the format to ##/##/####? does it have similiar properties to that of the textbox? (ie MaskEdBox.Text etc)any help would be greatly appreciated, i am a newbie to this control!Thank you!
|
|
|
|
|
mcm wrote:
how do i set the format to ##/##/####?
MaskEdBox1.Mask = "##/##/####"
You will need to check the values to make sure that the user entered the correct values, I would suggest you write a function:
Private Sub MaskEdBox1_KeyPress(KeyAscii As Integer)
'Do your stuff here...
End Sub
Nick Parker
The only man who never makes a mistake is the man who never does anything. - Theodore Roosevelt
|
|
|
|
|
Why dont' you try a DTPicker control - resembles a Combo, but when you hit the drop-down, it shows a Month in a calendar control. Still possible to directly enter a date, but won't let you enter an invalid one.
To use, right click your toolbox and select components. Scroll down the resulting list, and select "Microsoft Windows Common Controls 2 6.0 SP4", or browse to MSCOMCTL2.ocx. This will add the control to your toolbox, and can be used in the normal way. Help for the control is in MSDN under VBReference->Controls Reference->ActiveX COntrols
(Apologies if the preceeding is teaching my granny to suck eggs!)
|
|
|
|
|
Dim updateSQL As String
updateSQL = "Update Product Set " & _
" Description = '" & txtDesc.text & "', " & _
" Where Code = '" & txtCode.Text & "'"
Set RS = Conn.Execute(updateSQL)
This statement executes fine when i test it in access but here, it returns the above error. I have checked that all the fields are the same as that in the database and the textboxes match aswell. Neither txtcode or txtDesc are bound to any component. What could the problem be? if you need any more information, please let me know, any help would be greatly appreciated!!
|
|
|
|
|
You don't need the comma after the txtDesc.text. So the correct SQL command should work with:
updateSQL = "UPDATE Product SET Description = '" & txtDesc.text & "'" & _<br />
"WHERE Code = '" & txtCode.text & "'"<br />
<br />
Set RS = Conn.Execute(updateSQL)
HTH
|
|
|
|
|
Hi - i have a website in ASP, and was wondering if it's possible to have a status display of my login status for MSN messenger? (u know like the Yahoo! logged in/not logged in script)
Thanks
Paul W
Only the good die young, all the evil seem to live for ever. - Iron Maiden, Only the Good Die Young
modified 18-Jul-18 11:59am.
|
|
|
|
|
I have an app written in VB6 which uses the MSHFlexGrid. I would like to add heading to the columns which have two lines. Is it possible to use a CR in the heading text or am I forced to use two rows?
If as I suspect I have to use two rows, how do I hide the row lines in the heading rows?
|
|
|
|
|
Hi, I want to make such a software in which i want to connect my SQL database situated on a remote server to the software residing in my PC. So is there any other apporoach other then creating the DSN and using it with ADO?
Please tell me to be a professional software developer should i develope command over VB of VC++
Regards
|
|
|
|