Re: Can this be speeded up?


I have the following code where mcolNodeOrder is a collection object and oxmlNodeList is an XML node list. The purpose of the code is to produce a collection that is sorted by date. It works fine until there are more than about 4000 records in the collection at which point it slows down considerably. Can the code be speeded up

vb Code: strDateStamp = oxmlNodeList(lngIndex).childNodes(pmDateStamp).Text With mcolNodeOrder If mcolNodeOrder.Count > 0 Then For lngNOIndex = 1 To mcolNodeOrder.Count If strDateStamp < .Item(lngNOIndex) Then ' Add new entry before the one pointed at by lngNOIndex .Add strDateStamp & SEP & lngIndex, _ strDateStamp & _ oxmlNodeList(lngIndex).childNodes(pmFrom).Text & _ oxmlNodeList(lngIndex).childNodes(mintToNode).Text & _ oxmlNodeList(lngIndex).childNodes(pmTitle).Text _ , lngNOIndex Exit For End If Next If lngNOIndex > mcolNodeOrder.Count Then ' The datestamp is greater than any entry in the ' collection, so add it at the end .Add strDateStamp & SEP & lngIndex, _ strDateStamp & _ oxmlNodeList(lngIndex).childNodes(pmFrom).Text & _ oxmlNodeList(lngIndex).childNodes(mintToNode).Text & _ oxmlNodeList(lngIndex).childNodes(pmTitle).Text _ , , lngNOIndex - 1 End If Else ' Add the first one .Add strDateStamp & SEP & lngIndex, _ strDateStamp & _ oxmlNodeList(lngIndex).childNodes(pmFrom).Text & _ oxmlNodeList(lngIndex).childNodes(mintToNode).Text & _ oxmlNodeList(lngIndex).childNodes(pmTitle).Text End If End With Next
Posted On: Thursday 18th of October 2012 11:53:24 PM Total Views:  246
View Complete with Replies

RELATED TOPICS OF Visual Basic PROGRAMMING LANGUAGE




How to store random numbers in an array?

I have a series of unsequenced numbers which I want store in an array but do not want to declare a oversized array: How do I declare the array in such a way that I do not have to utilise 1000 array elements
VIEWS ON THIS POST

109

Posted on:

Thursday 18th October 2012
View Replies!

vb6 +Access db insert into entire collum

hi i have a form with : DataGrid1 Adodc1 textbox Command2 on form load i have this code : Code: Private Sub Form_Load() Adodc1.ConnectionString = ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & (App.Path & "\Database\data.mdb") & ";Persist Security Info=False;Jet OLEDB:Database Password=password") Adodc1.RecordSource = "Select * from phonia" Set DataGrid1.DataSource = Adodc1 End Sub i want at Private Sub Command2_Click() to insert into table phonia and colum 2008 the value of text1.text but i want to insert the value at entire collum sample : if text1.text = 2 table phonia colum1 | 2008 | mike 2 suzan 2 nick 2 george 2 clif 2 something like that. in entire colum 2008 i want to insert velue text1.text
VIEWS ON THIS POST

180

Posted on:

Thursday 18th October 2012
View Replies!

Re: Size up a PictureBox using .Width and .Height at runtime in a control array!!

I am writing some source code, that requires to have a control array on a Form. While I must be able to change the size of certain PictureBoxes in a control array. With only the commands: .Width and .Height\t I have tried everything, and nothing works!! Here is my source code: Code: If Form2.Text3.Text = "0" Then Exit Sub If Form2.Text3.Text = "1" Then Form11.BackGround1(l).Width = "200" Form11.BackGround1(l).Height = "130" Form2.Text3.Text = "0" Else If Form2.Text3.Text = "2" Then Form11.BackGround1(l).Width = "200" Form11.BackGround1(l).Height = "130" Form2.Text3.Text = "0" Else If Form2.Text3.Text = "3" Then Form11.BackGround1(l).Width = "200" Form11.BackGround1(l).Height = "130" Form2.Text3.Text = "0" Else If Form2.Text3.Text = "4" Then Form11.BackGround1(l).Width = "200" Form11.BackGround1(l).Height = "130" Form2.Text3.Text = "0" Else If Form2.Text3.Text = "5" Then Form11.BackGround1(l).Width = "100" Form11.BackGround1(l).Height = "65" Form2.Text3.Text = "0" Else If Form2.Text3.Text = "6" Then Form11.BackGround1(l).Width = "200" Form11.BackGround1(l).Height = "130" Form2.Text3.Text = "0" Else If Form2.Text3.Text = "7" Then Form11.BackGround1(l).Width = "1400" Form11.BackGround1(l).Height = "900" Form2.Text3.Text = "0" Else If Form2.Text3.Text = "8" Then Form11.BackGround1(l).Width = "200" Form11.BackGround1(l).Height = "130" Form2.Text3.Text = "0" Else If Form2.Text3.Text = "9" Then Form11.BackGround1(l).Width = "460" Form11.BackGround1(l).Height = "235" Form2.Text3.Text = "0" Else If Form2.Text3.Text = "10" Then Form11.BackGround1(l).Width = "200" Form11.BackGround1(l).Height = "130" Form2.Text3.Text = "0" End If End If End If End If End If End If End If End If End If End If End If
VIEWS ON THIS POST

105

Posted on:

Thursday 18th October 2012
View Replies!

Re: Interpreter In VB6?

New to VB6 can anyone give some samples of a GUI Interpreter that has gui functionsThank you
VIEWS ON THIS POST

100

Posted on:

Thursday 18th October 2012
View Replies!

TreeViwes Help Please?

a , I have a TreeView that when i click on the nodes, i want a form to appear: So for example: Example: - Examples (Click on this for a form to appear) If you can help me then please reply
VIEWS ON THIS POST

132

Posted on:

Thursday 18th October 2012
View Replies!

[Help Required] Deleting Records from a File

, I'm currently coding a system that allows the implementation of Stock/Customer details via text boxes, and loaded into listboxes. However, I am having trouble editing the relevant record's details and loading it back into the program - it simply does not work. Additionally, the deletion code doesn't work - can anybody help Enclosed is the code of the relevant buttons. This is the editing records code. Code: Private Sub cmdSaveEdit_Click() Dim NewStock As String * 12 Dim Newcost As Integer Dim Searchreg As String * 10 If (chkEditPrice.Value = 1) And (txtEditPrice.Text = "") Then MsgBox ("Please enter a valid price for the product") ElseIf (chkEditName.Value = 1) And (txtEditName.Text = "") Then MsgBox ("Ensure that you have named the edited product") ElseIf (chkEditPrice.Value = 0) And (chkEditName.Value = 0) Then MsgBox ("To edit a product, tick the corresponding check box and try again") ElseIf (txtEditPrice.Text = "") And (txtEditName.Text = "") Then MsgBox ("Please enter the details of the product into the text boxes") Else NewStock = txtEditName.Text Searchreg = txtStockIDSearch.Text stockfile = "J:\Computing\Customer.dat" Open stockfile For Random As #1 Len = Len(StockRecord) stockcount = LOF(1) / Len(StockRecord) stockfound = False stockindex = 0 Do stockindex = stockindex + 1 Get #1, stockindex, StockRecord If StockRecord.GameID = Searchreg Then stockfound = True If chkEditName.Value = 1 Then StockRecord.GameTitle = txtEditName.Text Put #1, stockindex, StockRecord End If If chkEditPrice.Value = 1 Then StockRecord.Price = txtEditPrice.Text Put #1, stockindex, StockRecord End If MsgBox ("Saved") End If Loop Until (stockfound = True) Or stockindex >= stockcount Close #1 End If End Sub This is my deleting records code: Code: Private Sub cmdDeleteStock_Click() Dim RecordCount2 As Integer Dim recordtodelete As String * 10 Dim BackupFilename As String lstStock.Clear stockfile = "J:\Computing\Stock.dat" Open stockfile For Random As #1 Len = Len(StockRecord) stockcount = LOF(1) / Len(StockRecord) For stockindex = 1 To stockcount Get #1, , StockRecord title = StockRecord.GameTitle ID = StockRecord.GameID Price = StockRecord.Price listofstock = "Game Name: " & title & "Unique Game ID: " & ID & "Price: " & Price lstStock.AddItem listofstock Next stockindex Close #1 BackupFilename = ("J:\Computing\BackupStock.dat") recordtodelete = InputBox("Please enter the Unique ID of the stock you wish to delete") stockfile = "J:\Computing\Stock.dat" Open stockfile For Random As #1 Len = Len(StockRecord) stockcount = LOF(1) / Len(StockRecord) Open BackupFilename For Random As #2 Len = Len(StockRecord) For stockindex = 1 To stockcount Get #1, stockindex, StockRecord If recordtodelete StockRecord.GameID Then RecordCount2 = LOF(2) / Len(StockRecord) Put #2, , StockRecord End If Next stockindex Close #2 Close #1 Kill stockfile Name BackupFilename As stockfile lstStock.Clear stockfile = "J:\Computing\Stock.dat" Open stockfile For Random As #1 Len = Len(StockRecord) stockcount = LOF(1) / Len(StockRecord) For stockindex = 1 To stockcount Get #1, , StockRecord title = StockRecord.GameTitle ID = StockRecord.GameID Price = StockRecord.Price listofstock = "Game Name: " & title & "Unique Game ID: " & ID & "Price: " & Price lstStock.AddItem listofstock Next stockindex Close #1 End Sub ANY HELP, is appreciated -
VIEWS ON THIS POST

143

Posted on:

Thursday 18th October 2012
View Replies!

Re: Functions and Procedure HELP!!

Code: Public Sub Find() Choice = InputBox("Enter Product Code") lstFind.AddItem "Product to be Found : " & Choice lstFind.AddItem "Product Name" & vbTab & "Product Code" & vbTab & "Stock Level" For Counter = 1 To 5 If Code(Counter) = Choice Then lstFind.AddItem Product(Counter) & vbTab & Choice & vbTab & vbTab & Stock(Counter) Else: MsgBox ("Code Not Found") --------------------------------- End If Next Counter End Sub Where there is "----------------------". What can i put there so it returns to the very top of the code
VIEWS ON THIS POST

95

Posted on:

Thursday 18th October 2012
View Replies!


I i am just now starting to make a Flash Server connection. I have the server all up and running and it works 100%. When i uploaded it to my server i recieved right after i got a connection. How do i send the crossdomain.xml file that i have right next to my server. VB6 Vista Winsock connection
VIEWS ON THIS POST

102

Posted on:

Friday 19th October 2012
View Replies!

Preset Text

How would I make a preset text, I have it in the menu, and assigned to a hotkey. I want it to make it so when you press the hotkey or click the button, the url appears in the textbox I assign it to. Is this possible , Do you want the URL to be an active link
VIEWS ON THIS POST

102

Posted on:

Friday 19th October 2012
View Replies!

[Resolved]Ticker of pictureboxes

friends! I want to put a ticker tape style of pictures on my form. I want them to scroll from right to left continuously so that it seems like they are rotating endlessly. I'm not sure how to do this the most efficiently or actually at all. If it was 1 picturebox moving it would be easy. Or if I created another picturebox with the 20 some picture box in that picturebox and then move the 2 pictureboxes froim right to left so it would appear endless...but couldn't I do this with my 1 picturebox as the main frame and the many picturebox with my pictures in it all move to the left until the left property + the width of the picture is less than 0 then move to the end of the chain... Hope you understand what I am trying to do
VIEWS ON THIS POST

96

Posted on:

Friday 19th October 2012
View Replies!

Create on XP SP3 and Install on XP SP2

I have developed a VB6 application on a computer running Windows XP Professional SP3. I use the VB6 Package & Deployment Wizard to create the install CAB and setup files. When installing the app on to a Windows XP Professional SP3 computer we have no problem. However, when I try to install on a Windows XP Professional SP2 I get an error message stating Setup cannot continue because some system files are out of date on your system and then asks if you want to reboot to automatically update the system files. If you click OK to accept rebooting, the system files are not updates as you are lead to believe. You can repeat this and the system files are never updated. The only solution that I have found is to go to the Windows Update site and perform all of the updates including installing SP3. After doing this I can successfully install my app. My question is this: How can I install an app on a Windows XP Professional SP2 computer when the app and install CAB were created on a Windows XP Professional SP3 computer Also, can I get that same app to install and run on a Vista OS computer and on a Windows 7 OS computer Thank you for your assistance.
VIEWS ON THIS POST

100

Posted on:

Friday 19th October 2012
View Replies!

document viewer in network share folder

Please help me to create application as per the req document viewer in network share folder
VIEWS ON THIS POST

118

Posted on:

Friday 19th October 2012
View Replies!

Re: Picture Box Stretch Property

HI! I know that there is a stretch property in image. but i want the stretch property to be applied to a Picture box. Is there a way i can do this in vb6. pls help me in this regard. with regards! Sethuraman R
VIEWS ON THIS POST

106

Posted on:

Friday 19th October 2012
View Replies!

Re: cler me please...dimensioned correct variable

Dim x, y, d, as long are dimensioned x y d long or is required to define all var as long Dim x as long, y as long, d as long
VIEWS ON THIS POST

90

Posted on:

Friday 19th October 2012
View Replies!

Re: transparent form...!!!

did some here can make a transparent form\t\t
VIEWS ON THIS POST

126

Posted on:

Friday 19th October 2012
View Replies!

Re: How to create wone ActiveX Control

Hai every one I Need Help I have created my won Textbox with case type selection and numeric Useing with ActiveX Controls in VB6 this is working fine but some of the things or i am not able to add to this textbox can any one help me i attach the full Project This are the items im not able to add to this textbox (1) Hide Selection (2) MultiLine (3) ScrollBars (4) Data Field (5) Data Format (6) Data Member (7) Data Source by srikanth Reddy Email Address Removed By Mod
VIEWS ON THIS POST

93

Posted on:

Friday 19th October 2012
View Replies!

Re: Data report!! Please help

I am trying to display report depending on the query that i send.. Code: .Commands("Command11").CommandText = "SELECT tblstudent.Ln + ', ' + tblstudent.Fn + ' ' + tblstudent.Mi AS FullName, tblprof.Ln + ', ' + tblprof.Fn + ' ' + tblprof.Mi AS Professor, tblsubject.Description, tblstudent.StudNo, tblProf.ProfID, tblsubject.SubjCode, MajorExam, Project, CP, CS, Quiz, Attendance, MIDTERM FROM tblmid, tblsubject, tblstudent, tblprof WHERE tblstudent.StudNo = tblsubject.StudNo AND tblstudent.StudNo = tblmid.StudNo AND tblsubject.StudNo = tblmid.StudNo AND tblProf.ProfID = tblmid.ProfID AND tblsubject.Subjcode = tblmid.SubjCode order by tblstudent.Ln asc" in this query i just want to try if it will work but as i try it i got an error of Command1.FullName Datafield not found!, and also i think the problem is within the datareport, cause the text6,text10 and so on's datamember is command1 not command11,, how could i display my parent-child link in datareport using the query that i send\t Please Help tnx for reply
VIEWS ON THIS POST

102

Posted on:

Friday 19th October 2012
View Replies!

Re: Rounding to the nearest 10th ...is there a function?

... quick question: i know you can go : Round(20.5 / 3, 1) and round to 1st place to the right of the decimal.... but what I'd like to do is round to the nearest tenth... 246 --> 250 12343 --> 12340 any help would be appreciated,
VIEWS ON THIS POST

167

Posted on:

Friday 19th October 2012
View Replies!

multiple email - error is unknown recipient

my recipients' address to be imported from a database to a textbox. but i keep on getting an error of unknown recipient. please help me with this. these are my codes for my send button so far Code: Dim StartPos, Counter As Integer Dim FindString, ReplaceText As String FindString = " " ReplaceText = " ; " For Counter = 1 To Len(address.Text) StartPos = InStr(address.Text, FindString) If StartPos > 0 Then address.SelStart = StartPos - 1 address.SelLength = Len(FindString) address.SelText = "" + ReplaceText End If Next Dim s Dim se() As String Dim InputContainer As String InputContainer = address.Text se() = Split(InputContainer, " ; ") Dim i As Integer ListView1.ListItems.clear For i = 0 To UBound(se) Set s = ListView1.ListItems.add(, , se(i)) Next MAPISession1.SignOn MAPIMessages1.SessionID = MAPISession1.SessionID 'Compose new message MAPIMessages1.Compose 'Create the message MAPIMessages1.MsgSubject = subj.Text MAPIMessages1.MsgNoteText = body.Text 'Address message Const SESSION_SIGNON = 1 Const MESSAGE_COMPOSE = 6 Const ATTACHTYPE_DATA = 0 Const RECIPTYPE_TO = 1 Const RECIPTYPE_CC = 2 Const MESSAGE_RESOLVENAME = 13 Const MESSAGE_SEND = 3 Const SESSION_SIGNOFF = 2 Dim q As Integer Dim w As Integer q = 0 w = 0 Do While q < 3 And w < 3 MAPIMessages1.RecipIndex = q 'First recipient MAPIMessages1.RecipType = RECIPTYPE_TO 'Recipient in TO line MAPIMessages1.RecipDisplayName = se(w) q = q + 1 w = w + 1 Loop MAPIMessages1.Action = MESSAGE_RESOLVENAME 'Send the message: MAPIMessages1.Action = MESSAGE_SEND MAPISession1.SignOff
VIEWS ON THIS POST

120

Posted on:

Friday 19th October 2012
View Replies!

need to read a variable or text from a website, not sure which it is :)

I use VB 6 - Microsoft Internet controls and i would like to read 2 things from a website, is that somehow possible I marked the values i wanna read red in the following source code from the website 3 100% would be happy if some1 could help me thx
VIEWS ON THIS POST

159

Posted on:

Friday 19th October 2012
View Replies!