Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Ahhhh!! Winsock Error Driving Me Nuts!!


Whilst trying to connect using Winsock on a random port (LocalPort=0), I keep getting sckAddressNotAvailable 10049 Address not available from the local machine.

***??? I have an identical winsock control in the same project using almost identical code and that works no problemo. I fished about in Ms knowledge base, but that was about as much use as a chocolate teapot.

Help!! I wish to retain my hair

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
My Error Handler Is Driving Me Nuts!!!!
Hi gus please check this code

dim settings as string
dim fso as New FileSystemObject
dim fsoTextSteam as TextStream

Private Sub OpenSettingsFile()
        On Error GoTo ErrorHandler
        Set fsoTextStream = fso.OpenTextFile("Settings.txt", ForReading, True, TristateUseDefault)
        settings = fsoTextStream.ReadLine
         MsgBox "ECIS cannot obtain current settings in your PC. " + _
                 "Please reconnect your database in main menu.", _
                 vbInformation, "No Settings Found"

End Sub

my problem is that i keep getting the error message even when i can get the line in the text file. any suggestions?

This Is Driving Me Nuts - CDO 1.21 Automation Error When Trying To Initiate
VB Code:
Private Sub Form_Load()      Dim objSession As MAPI.Session      Dim objMsgColl As Messages      Dim objMsg As Message      Dim objInbox As Folder      'Create the Session then Logon.      [b]Set objSession = CreateObject("MAPI.Session")[/b]      objSession.Logon      Set objInbox = objSession.Inbox            Set objMsgColl = objInbox.Messages      For Each objMsg In objMsgColl         MsgBox "Subject: " & objMsg.Subject      Next      Set objMsg = Nothing      Set objMsgColl = Nothing      Set objInbox = Nothing      objSession.Logoff      Set objSession = NothingEnd Sub

the text in bold is where the error occurs..

"Automation error
Unspecified error"

is what i get... its driving me nuts.. im using CDO 1.21 cdo. dll to try this on windows xp..

Arr, This Is Driving Me Nuts...
Allright, heres the deal, im working on a program to parse html source, collect few words from it, (or even words from word to word)... and i used this code to for example collect images and such:

works fine..

but as you can see, i sort the "test" text by spaces... usually it works fine... but sometimes its a pain in the arse..


sometimes i want to find a word, and collect the word after that word..

then i split the source up by spaces.. , the code is "something" like this (just what i would usually write to parse code):

dim url as string
dim source() as string

url = inet1.openurl("")

source = split(url, " ") 'add it into an array by spaces..

for i = 0 to ubound(source)
if source(i) = "Test:" then ' check if the current word is Test:
text1.text = source(i + 1) 'text1 would equal the word after that
end if
next i

that "should" work if there was the word "Test:" in the source... BUT
sometimes a html code can look like this:

(br) (i dont have the arrow thingy on my laptop keyboard:P)

as you can see, return spaces arent counted as spaces.. so Test: is actually the word

and therefor text1 will equal nothing because it didnt find Test: in the text..

i tried alot of things, trying to seperate the returns.. like replacing vbcrlf with spaces, then split by spaces.. didnt work, then i tried to split by return spaces, then split that by spaces (obviously didnt work)..

this is killing me.. do you guys (and girls) have any idea on how to seperate, and put every word in the array, by spaces AND crlf's

Please Someone Help .... This Is Driving Me Nuts !
I've just been upgraded to Windows XP (don't ask !).
Now my scroll button doesn't scroll in VB6, although it does in Word, Excel etc., but weirdly not in the VBA environment ?!?!!

I've installed Microsoft Intellipoint software from Microsofts site, and selected the right mouse (Microsoft wheel mouse optical), rebooted etc etc etc ... but no. Is it because its Monday ? Or do I have to strangle our tech support one by one with the cable ?

Answers on a postcard to the usual address ......

p.s. It IS VB related, because I can't scroll in VB, therefore this post need not be moved (to the bin) )

This Is Driving Me Nuts!

I have created a custom tool bar for my Word application. However, when I start Word, 15 instances of the custom toolbar appear.

So I go ahead and delete them and attempt to reopen again, only to see the same 15 instances yet again.

Has this happened to anybody else who has created a custom toolbar?

I have even implemented a delete routine into the exit funcition of, but to no avail. When I start Word, I still see the same number of instances.

Weird. Any ideas before I go crazy?


This Is Driving Me Nuts!
Ok, here is the code I want to use to get the time.


Dim hWndTask As Long, hWndTray As Long, hWndClock As Long
hWndTask = FindWindowEx(0, 0, "Shell_TrayWnd", vbNullString)
hWndTray = FindWindowEx(hWndTask, 0, "TrayNotifyWnd", vbNullString)
hWndClock = FindWindowEx(hWndTray, 0, "TrayClockWClass", vbNullString)
Text2.Text = WindowText(hWndClock)

I want this function to loop until the time displayed in Text2 = the time in text1.text & " " & combo1.text. Then if these two are = I want to call shellexecute and end the loop event. This for an alarm clock. Any help is greatly appreciated. I've tried several ways with no luck, and this is driving me nuts.

This Is Driving Me Nuts
Okay I have created an activex dll

On my development system which is running win 2k i can compile the dll and my exe and it works fine

however as soon as I install these onto a win98 system and run it I get Runtime error 429 I cant figure out what is causing this problem.

Can anyone help me out at all with this

Bye the way the dll contains code for connecting to an access database via ado

This is becoming very urgent so any and all help will be apprectiated.


Driving Me Nuts!!!!!
Private Sub Check()

If Box1.Picture = Picture(App.Path & "graphicsX(inverted).jpg") And Box2.Picture = Picture(App.Path & " graphicsX(inverted).jpg") And Box3.Picture = Picture(App.Path & "graphicsX(inverted).jpg") Then
ElseIf Box4.Picture = App.Path & "graphicsX(inverted).jpg" And Box5.Picture = App.Path & " graphicsX(inverted).jpg" And Box6.Picture = App.Path & "graphicsX(inverted).jpg" Then
ElseIf Box7.Picture = App.Path & "graphicsX(inverted).jpg" And Box8.Picture = App.Path & " graphicsX(inverted).jpg" And Box9.Picture = App.Path & "graphicsX(inverted).jpg" Then
ElseIf Box1.Picture = App.Path & "graphicsX(inverted).jpg" And Box4.Picture = App.Path & " graphicsX(inverted).jpg" And Box7.Picture = App.Path & "graphicsX(inverted).jpg" Then
ElseIf Box2.Picture = App.Path & "graphicsX(inverted).jpg" And Box5.Picture = App.Path & " graphicsX(inverted).jpg" And Box8.Picture = App.Path & "graphicsX(inverted).jpg" Then
ElseIf Box3.Picture = App.Path & "graphicsX(inverted).jpg" And Box6.Picture = App.Path & " graphicsX(inverted).jpg" And Box9.Picture = App.Path & "graphicsX(inverted).jpg" Then
ElseIf Box1.Picture = App.Path & "graphicsX(inverted).jpg" And Box5.Picture = App.Path & " graphicsX(inverted).jpg" And Box9.Picture = App.Path & "graphicsX(inverted).jpg" Then
ElseIf Box7.Picture = App.Path & "graphicsX(inverted).jpg" And Box5.Picture = App.Path & " graphicsX(inverted).jpg" And Box3.Picture = App.Path & "graphicsX(inverted).jpg" Then
ElseIf BoxS1 = 1 And BoxS2 = 1 And BoxS3 = 1 And BoxS4 = 1 And BoxS5 = 1 And BoxS6 = 1 And BoxS7 = 1 And BoxS8 = 1 And BoxS9 = 1 Then
End If

End Sub

I need help, it gives me a type mismatch error!! and i dunno how to fix it. Please check the syntax and setting of the code for me


VB Forms Driving Me NUTS!
Hey all,

I am obvoiusly missing something simple here, but I can't see the forest for the trees so to speak.

Essentially I have:

Programs executes at a module which does Authentications and few other sundries.

The module passes control to a form via a command.

Form 1 opens a database and populates a listbox from a SQL table.
The user selects an item from the listbox and presses a button.
The form then assigns the value of the listbox item to a global variable (I know, I know) and then calls form2 (

Form 2 then allows the user to modify records in the DB matching the record in the global variable., It then calls form1 again.

This is where the wheels fall off.

Form 1 never seems to activate again.

Every time form 1 and form 2 are called I need the Form_Load methods to execute. I have tried Unloading the forms both before and after the show command to the next form.

Please would somebody point me in the right direction.



SQL QUERY Is Driving Me Nuts!!!
I'm trying to get this query running I know I must be missing something easy.

I'm trying to count all the records in a group that dont have a value in them and if there is one in the group I want all of them otherwise I dont.
The query works fine without the where so Its something in there.

Heres what I have starting from my WHERE clause.

where if(count(*) from mytable where myfield is not null) > 1);

Help Please!!!!!

Dates Driving Me Nuts!
I am searching for all files in a given directory, getting the dates each file was created, and (trying) to open the most recent one.

For some reason, when I try to convert the FILETIME structure to SYTEMTIME and ultimately just to date, something seems to get messed-up in the minutes. The date and hours are fine....

I'll include my structures, in case they are wrong...

File searching is done via API into Win32_FIND_DATA structure...

Public Type WIN32_FIND_DATA
dwFileAttributes As Long
ftCreationTime As FILETIME
ftLastAccessTime As FILETIME
ftLastWriteTime As FILETIME
nFileSizeHigh As Long
nFileSizeLow As Long
dwReserved0 As Long
dwReserved1 As Long
cFileName As String * MAX_PATH
cAlternate As String * 14
End Type
'ouput' is an array of summarised data for the found files, of myu own UDT called "FileDetails"

Public Type FileDetails
FullName As String 'Stores the full path
PathOnly As String 'Stores the path only.
FileOnly As String 'Stores the file name only.
CreationTime As FILETIME 'Stores the time info for when the file was created.
End Type

'Get FileTime from found file
wtFILETIME = WFD.ftCreationTime

'Update array
ReDim Preserve Output(FP.nCount) as FileDetails
With Output(FP.nCount)
.FullName = sRoot & sTmp
.FileOnly = sTmp
.PathOnly = sRoot
.CreationTime = wtFILETIME
End With

Now try and get the file time...

'Dim variable to allow the FileTime to be corrected for daylight saving
Dim LocalFileTime As FILETIME

'Temp variable to hold the timestamp in SystemTime
Dim SystemDate As SYSTEMTIME

'Temp Variable to hold the File Creation date.
Dim FileCreation As Date

'Convert to local time
Call FileTimeToLocalFileTime(Output(i).CreationTime, LocalFileTime)

'Now convert to system time
Call FileTimeToSystemTime(LocalFileTime, SystemDate)

'Now convert to a vb date
Call SystemTimeToVariantTime(SystemDate, FileCreation)

'Previous code that gave same (wrong) result
'With SystemDate
' FileCreation = CDate(DateSerial(.wYear, .wMonth, .wDay) & " " & TimeSerial(.wHour, .wMinute, .wSecond))
'End With
Debug.Print Output(i).FileOnly & " was created on " & FileCreation

Just including the other strucutres, in case they are wrong...

Public Type FILETIME
dwLowDateTime As Long
dwHighDateTime As Long
End Type

wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type

Please help....

Edit: The output minutes seem to be always multiples of 10 (10, 20)

Driving Me Nuts! Simple...
I'm having problems with my if statement...
here it is:

If curPlayer(bipl).Y = pb(PbNum).Y Or (pb(PbNum).Y - 1) Or (pb(PbNum).Y + 1) Then
blah blah blah
End If
I ran in debug mode and curPlayer(bipl).Y was equal to 20 and pb(pbNum).y was equal to 26 and it still ran through to the "blah blah blah"
Very frustrating.. i'm figuring i didnt' setup my if correctly though.. Thanks for any help!

This Should Be Easy... But It Driving Me Nuts
I am calculating mbps transfer speeds in an app. To Calculate the number of seconds that it take to transfer the data I am using DateDiff("s",StartTime, EndTime)

Problem 1: This always gives me an even second. Is there any way to get a more precise amount of time?

Problem 2: When I divide the Amount of Data by the Number of seconds, It always gives me 1 for an answer.

Here is the code:

VB Code:
AmtTransfered = MakeMB(ttlSize)    StatMaxCount = TotalFileCount    ProgressBar2.Max = StatMaxCount    ProgressBar2.Min = 0    Tr1StartTime = Now()    For Each Ofile In oFileCollection                  Ofile.Copy ("c:!ttw")      ProgressBar2.Value = ProgressBar2.Value + 1          Next    Tr1EndTime = Now()    Trial1mbps = CInt(DateDiff("s", Tr1StartTime, Tr1EndTime))        Stat1.Caption = AmtTransfered    Stat2.Caption = Trial1mbps    StatusText.Caption = FormatNumber(AmtTransfered Trial1mbps, 2)

Thanks for any input on this one...

Registerhotkey, Driving Me Nuts
I have followed this example here:

and it works, BUT only from within the application...could someone please help me get this thing to monitor for the hotkeys outside the application/systemwide/when the app does not have focus?

or point me in the right direction?

here is what I'm hoping to do:
I press F1 from anywhere in windows
it moves a string (hard coded in the app) to the clipboard

I press F2 from anywhere in windows
it moves a string (hard coded in the app) to the clipboard
etc etc

just to be clear..when I am inside the app it works fine

any kind of help is appreciated..thanks

**found info, I will be trying to figure out a system wide keyboard hook

HELLLLP!!! This Is Driving Me Nuts!
I wrote a simple app to perodically check my outlook email. When it starts the check (after a certain time interval), I pop-up a second, smaller form with it's show method. This second form simply shows the application's progress (with a progress bar) and an out-of-control text box showing the current MailItem's subject text that is being checked. My problem is with the form showing up. The Progress bar and Textbox show up, but the form is hidden. It actually looks transparent. When the check is complete, the form disappears when it's hide method is executed (like it should). Everything seems to be working, except for the fact that the form is transparent. I have checked all of the properties to make sure I wasn't setting the background to transparent or something stupid like that. Could anyone give me any ideas on what I could be doing wrong. I have this feeling that the problem is something really simple and will really piss me off when I figure it out.

Thanks in advance for any help!

Ken Fitz

This Is Driving Me Totally Nuts!!!
I downloaded three cool looking internet peer to peer chess programs but they need mswinsck.ocx . . . I've looked all over the web. Shouldn't winsock be installed with WinME? I ran a search for it but it's not on the hard drive, I installed sp5 but it's still not there, so would someone be so kind as to point me in the right direction?

WinNT Driving Me Nuts...
hi ppl,
I've been using WinMe and 98 for a while now, but i've just about had it with the idea that if one application goes down then the whole system does. I know winMe's supposed to be better as it launches the explorer and taskbar in different process, but by the time Me boots up i've practically run out of RAM (128mb).
I've tried Win2k but it lags like a game of Q2 running on 14kbps modems.. (700mzh duron, 30gb disk). I haven't tried Linux since i had my 486 and i don't really want to migrate to C iether. So my last resort is to install NT4.0, but to my dissapiontment NT4.0 does not support drives above 2gb as a single partition (*** is going on in MS?). NT4.0 does not recognise NTFS5 used in win2k so i can't install Win2k and replace it with NT4.
So the question is, "How do you install NT 4.0 on a 30gb Disk without creating unreasonable number of partitions?". And is the service packs inclusive? i.e. do you need sp1 to install sp2?


opps. sorry i know i posted this in the wronge section, it won't happen again

I made a program with a vb progressbar inside. Now (on other comps) the installation errors up because VBUPROGRESS.OCX can not be registered, i even tried it manually, no go................what is going on??? Much Thanx

SQL Syntax Driving Me Nuts..
I Have an SQL query that should be correct but when I run it and step through the code it is giving me a syntax error and I don't know what exactly could be the problem...

Any suggestions....

second line is the code where the error occurs

nErr = myObj.DoQuery(Handle, "GETGROUPS", "WHERE ReportID=" & CStr(gaReports(GetItemData(cboReports)).nID))

If myObj.ReportError(Handle, nErr, "attempting to read the list .", App.title) Then

and this is the query form my comms.ini file


so I am selecting everything from rptGroups table where ReportID = X


Visual Sourcesafe Is Driving Me Nuts
VSS has decided that it will always replace writeable local files regardless of whether I have configured it to Ask/Leave etc.

Im on a new machine, is there a setting I am missing somewhere? I have used

Tools->Options->Local Files->Replace local files = ask.

I've taken it out of the VB6 IDE.

Any suggestions?

Copying Records Driving Me Nuts!
Ok, I need to copy records from a MySQL database online, to a MS Access database stored on the users computer. I'm using ADO. I've got connections working, can view data, etc. I cannot work out how to copy a record from one db to another. I've read most of these forums on the topics and all there is, is details on copying from a locally stored Access db to another locally stored Access db using INSERT. This does not help me.

I need a way to copy a record from the MySQL database to the MSAccess Database and the other way round. I have too many fields to put them all in a statment in code. I need a way to copy a record, regardless of what fields exist. If this is not possible, then please give me a way to do it using the fields.

Excel COM Not Shutting Down - Driving Me Nuts
When i run this code by clicking the command button:

VB Code:
Dim objExcel As Excel.Application Private Sub Command1_Click()    Dim strexcelfile As String        strexcelfile = "C: st.xls"    Set objExcel = New Excel.Application    Dim objworkbook As Excel.Workbook    Set objworkbook = objExcel.Workbooks.Open(strexcelfile)    objExcel.Sheets("Sheet1").Select        objExcel.Cells.Select        'vvvvv THE OFFENDING LINE FOLLOWS THIS COMMENT vvvvvvvvvvvvvvvvvv    objExcel.Selection.Sort Key1:=Range("A2"), Order1:=1, Header:=1, _        OrderCustom:=1, MatchCase:=False, Orientation:=1, _        DataOption1:=0             objExcel.Visible = True        Set objworkbook = Nothing        Set objExcel = Nothing                    End Sub

and then manually close the excel spreadsheet (i leave my app running though) an instance of EXCEL.EXE is still active. pushing the button again causes my app to crash.

when i remove the sort line, this odd behavior goes away. Can anyone explain to me why this is happening and/or how i can correct it?

Outlook XP Security Is Driving Me Nuts !
I've got a program which interrogates an Inbox, then allows the user to take the mail information and log it into a database. When it does this it mails the originator back to say we have got their mail and also mails a safe copy of the original mail to another address. This all worked fine using Outlook 2000. We have just 'upgraded' to Office XP and Outlook XP. Now every time my code tries to go thorugh this process I get those annoying messages about anoyther program trying to access my inbox/another program is trying to send mail on my behalf. I've searched Microsoft etc and can't find a way of turning this stuff off. We have virus checkers and scanners which check all incoming mails and remove dodgy attachments, why on earth do we need this aswell.

Please, does anyone know how to stop this happening??



File Selection Driving Me Nuts !%?##
Hi again, been working on this for too many nights now and still can't come up with the answer to this#!?

I'm trying to figure out the code for grabbing only some selected files (mp3) within a FileListBox and building a playlist with them.

So far most of what I got here works except it won't let me work with the selected files but rather all of them.

I mean is this at all possible? please tell me before I drive myself nuts.
Thanks and here the code I came up with so far:

VB Code:
Private Sub Command4_Click()Dim retVal As LongDim m3u As StringDim FP As StringDim x FP = App.Path & "list_box.m3u"  If File1.ListCount = 0 Then GoTo Out Open FP For Output As #1For x = 0 To File1.ListCount - 1  Print #1, TreeView1.SelectedItem.Tag & "" & File1.List(x)Next x Close #1m3u = App.Path & "list_box.m3u"    retVal = ShellExecute(Me.hWnd, "Play", m3u, vbNullString, m3u, SW_SHOWNORMAL)Out:End Sub

Ambiguous Name Detected: ~ Driving Me NUTS!!!!!!!!! Help!!!!!
OK, here's the thing:

i have w2000 pro
visual studio 6.0 sp5

everytime i try to use mscomctl.ocx in mi program i get this error:
Ambiguous name detected: ~
i'm just trying to use the toolbar object!!!!

this happens in a new project and in a project that has the toolbar already.

i would really appreciate some help.

RichTextBox .SelBold Is Driving Me Nuts * RESOLVED
I'm using this code which I got here at VBForums:

VB Code:
Private Sub txtSession_Change()     Dim nPos As Long        nPos = -1    Do    nPos = txtSession.Find((Trim(txtSendTo.Text) & ":"), nPos + 1, Len(txtSession.Text))        If nPos <> -1 Then            txtSession.SelColor = vbBlack            txtSession.SelBold = True        End If    Loop While nPos <> -1        'txtSession.SelStart = 0    'txtSession.SelLength = 0    txtSession.SelBold = FalseEnd Sub

First time it runs, its ok. But on succeeding calls it sets all text to bold instead of just the result from .Find. Actually, even before the procedure starts statements on the 2nd and succeeding calls(I put a break on Private Sub txtSession_Change()), all the text is already changed to bold.

I inserted txtSession.SelBold = False in hopes of preventing this but it had no effect. I even tried the statements above that are commented out. This is the only procedure in the project wherein .SelBold is used so the prob can't be anywhere else. I checked .SelLength, .SelStart, and .SelText right after executing .Find and their values are ok, but the text still turns to bold. I checked the value of .SelBold in several other procedures (before and after the call to this procedure) and its value is false as expected. I CAN'T FIGURE OUT WHAT'S WRONG.

Can someone please help me?

Arrrgh, This Is Driving Me Flippin Nuts!! [Resolved, Thank You]
I'm using the Microsoft Agent control to read someone's E-mail aloud to them. Problem is that when I get to the mail reading routine (this is where I'm implementing it) I get this error:

Class AgentObjectsCtl.Agent of control Agent1 was not a loaded control class.

I have downloaded every component on the MS Agent download page, and I still get this error. What is it looking for?

Function Call Question Driving Me Nuts!
I have a function where I am passing it a string variable. The variable looks like this:

dim url as string, strUrlSubmit(9) as string
url = "" & strUrlSubmit(i) & "&dq="

'Then I call the function
SubmitUrls url ' the only argument

Within the function HOW do I evaluate the variable strUrlSubmit(i) that is embedded within the variable url? I need to loop through this variable strUrlSubmit(i). I know how to loop through the arrayed variable, just don't know how to evaluate a variable inside a variable.

Thanks you gurus!

This Is Driving Me Nuts..please Help...Recordset Update Problem
Okay, what am I missing here? I have an app that uses MS ACCESS as the
backend datasource. I want to prevent the user from trying to click the
update button without typing required info in 2 textboxes. How should i go
about doing this? Below is what I have so far, to combat the error about
not being able to insert empty row into database (the error I get when
trying to update without filling in any info on form)

Private Sub cmdUpdate_Click()
If txtEventtype.Text > "" Then
End If

If ErrorNumber = 16389 Then
If AdoDailyEvents.Recordset.State = ADODB.adStateOpen Then
fCancelDisplay = True
Else: AdoDailyEvents.Recordset.Update
End If

End sub

However if I type in some text in the txtEventType text box and click
update, no update occurs. Please tell me what I am doing wrong? Also,
please tell me if there is an easier way to accomplish what I am trying to
accomplish. Basically what I want is to Disable the UPDATE button until 2
of my text boxes have something typed in them. Once this info is typed in,
I want the update button to become available to update the record.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~

Grrrrr..... SQL Is Driving Me Nuts ! Data Type Mismatch
Hi ( again ! )

I have this line in myprogram where I am trying to execute a sql statement.

Set rsttemp = xlsdatabase.OpenRecordset("SELECT COUNT(*) AS RecCount FROM AccumPQR WHERE [PQR #] = ' " & rstlinked![PQR #] & " ' ")

data type mismatch type in criteria expression.

PQR the field I am trying to match is a number in both the table and the recordset in the sql. I think it might be something to do with ' " & rstlinked![pqr #] & " ' part of the expression as this field is a number in both tables.
Is the expression maybe making it a string because I have inclosed it with quotes ?

Help , how do I do this, match a number with a number.

Thx .

UPDATE Access Stored Query Driving Me Nuts
I am running the following stored query:

CODEUPDATE Master SET JobNum = [@revJobNum], JobName = [@revJobName], Programmer = [@revProgrammer], MailDate = [@revMailDate], RevisedDate = [@newRevisedDate]
WHERE [JobID]=[@curJobID];

Driving Me Nuts! How To Test For Page Load In Browser Control???
I am at my wits end! I know this sounds like an easy question, but I have tried this a hundred ways, and cannot find a way that works and that is practical. Please, somebody help me solve this problem.

My program grabs 3 web pages (one at a time), parses the html to determine if a number on the page has changed, then does it all over again, continuously until a change is detected.

Unfortunatley, I cannot use the Inet control, because the html that the Inet control gets from the server isn't quite the same as what the browser gets, probably due to an idenitty issue (maybe cookie?).

Anyway, I have to use the browser control and get the html from there.

So, I need to do something like this:
objBrowser.Navigate someURL

strHTML = objBrowser.Document.body.outerHTML

strResult = GetBetween(strHTML, strStartDelim, strEndDelim)

Seems really simple, right?

Wrong. This code doesn't work, because it executes too quickly, before the browser is finished downloading the HTML.

I realize that I could just end the procedure and then rely on the objBrowser_DocumentComplete() event to execute the rest of the code, but then I would lose the flow of the program. What if the DocumentComplete() event never fires? My program will hang.

So, I tried adding a variety of different loops to wait for the page to download, such as the following:

objBrowser.Navigate someURL

Do While objBrowser.Busy
    Do stuff

strHTML = objBrowser.Document.body.outerHTML
strResult = GetBetween(strHTML, strStartDelim, strEndDelim)

But that just causes an infinite loop, and the program has to be forced to quit. As long as the loop is running, the browser won't finish loading the page.

I also tried loops like these:
Do Until (objBrowser.LocationURL = strCurrentURL)
    Do stuff

'This one waits for the DocumentComplete() event to
' set the blnPageLoaded variable to TRUE.

Do Until blnPageLoaded
    Do stuff


As long as the loop is running, the browser never finishes, the DocumentComplete event never fires, so a loop seems to be out of the question, unless I can somehow start it in a seperate thread, but I've never done multi-threading in VB and I question whether multi-threading is even apropriate here.

Isn't there some way to trap the DocumentComplete event inside my procedure? Or something? I just need for my program to pause momentarilly until the page is loaded.

Please help! By the time I get this program finished my hourly rate will be $2.00 an hour!

Greg Norris
Software Developer

Constructed from 100% recycled electrons.

Common Dialog "Current Page" Driving Me Nuts
Hi all,
I have a question, for printing out something I use the common dialog:

VB Code:
With CDLG        .Copies = 1        .PrinterDefault = False        .Min = 0        .Max = 99        .Flags = &H4                '.CancelError = True        .DialogTitle = "Select Printer"        .Flags = cdlPDHidePrintToFile Or cdlPDPageNums Or cdlPDNoSelection        .FromPage = 1        .ToPage = 9        .ShowPrinter        Debug.Print    End With

Does anybody know how to ENABLE the "current page" option?

Really Need Help! Driving Me Mad! WINSOCK IN ACCESS!
I am trying to test winsock chat between client and server in an access database. It will eventually include a database on the server side but i have simplified it as much as possible so i can get the winsock control working first.

The client and server connect fine and i know all the code works (i tried it in vb and it worked fine) but when i send the messages either way in access, the text is unreadable. I think it is because access is using a different method to store text in the way it sends it to the way it receives it. However, this makes no sense at all.

Ne ideas on how this can be overcome? Here is my project (NB. open server, followed by client and input to connect to yourself when prompted by client):

Winsock Problem Driving Me Crazy......
soo close to being done......

ok im making a small multi player game, ever 300 miliseconds it sends everyones position and thats about it, nothing too in depth. But for some odd reason, i load up a few clients and olny the most reciently connected ones work.

Ex.(numbers are the index they connect)
i connect client 0-2 to the server client 2 works perfect but 0 and 1 dont do anything, i have it msgbox on data arrival and i get nothing.... then i close 2 and 1 seems to have backed up that code and runs threw it really fast and 0 still does nothing but 1 now works perfectly, and so on, close 1 and 0 works perfect.....

so my question is do i have to like force winsock to look for data? or whatnot, im totaly stumped and this is the best way i think i can put it =]

Winsock Is Driving Me Insane.. Prolly An Easy Q..
OK, i made a web server in VB/Winsock, and it works fine on BUT when i try to use anything else (including: localhost, my pc's name, or my *actual* IP), it doesnt work at all.

Any ideas?

btw: if you need it, my "listen" code is:

VB Code:
Private Sub Form_Load()gport = 80   ' Only connection(0) listens, all others are connections  sktconnection(0).Close  sktconnection(0).LocalPort = gport  sktconnection(0).Listen   MsgBox ("Server is Listening on port " & gport) End Sub

Thankyou kindly young sir/maam,

Division By Zero Error Driving Me Mad!!
The program calculates approx. how long it takes to burn a CD at a certain speed. I keep getting division by zero errors on this one line:

Private Sub Calculate_CustomCD()
Dim custom1 As Long
custom1 = Int(ccdsize.Text)

If ccdsize.Text <> "" Then customcd.Caption = "Burning a " & ccdsize.Text & "MB CD at:" & cdspeed & "x (" & 150 * cdspeed & "k/s) would take: " & formatLength((custom1 * 1024) / (cdspeed * 150))

End Sub

formatlength is a sub for converting seconds into hours, minutes, seconds.
I can't find the error anywhere in that line and it's driving me INSANE

thanks in advance...

ADO Error Driving Me NUTTTTTTSSSS .... :-((
i am frustrated by this ADO error....

err.number = -2147217864
err.desc = the sepecified row could not be located for updating.some rows might have been changed since it was last read......

i am using ADO 2.5 with VB 6.0 and Oracle 8 at the back end..this comes in a fairly large but not complex happens generally after saving records ( .update statement)....
i am not able to trace out the sequence which causes this....everything seme to working fine when this errors crops up and wreaks havoc.... i have to submit my progs tomm for testing. pleassssssssse helppppp

waiting desperately....


This Error Is Driving Me Crazy

I've been trying to figure out the cause of this error but
have not been able to.

VB6 Code:


Private Sub BuildPostData(ByteArray() As Byte, ByVal strPostData As String)
Dim intNewBytes As Integer
Dim strCH As String
Dim i As Integer

intNewBytes = Len(strPostData) - 1

If intNewBytes < 0 Then
Exit Sub
End If

ReDim ByteArray(intNewBytes)

For i = 0 To intNewBytes
strCH = Mid$(strPostData, i + 1, 1)

If strCH = Space(1) Then
strCH = "+"
End If

ByteArray(i) = Asc(strCH)
End Sub

Private Sub Command1_Click()
Dim strPostData As String
Dim strHeader As String
Dim varPostData As Variant

'Make the Post Data String
strPostData = "Name1=Value1&Name2=Value2"

'Pack the post data into a byte array
BuildPostData bytpostdata(), strPostData

'Write the byte into a variant
varPostData = bytpostdata

'Create the Header
strHeader = "Content-Type: application/x-www-form-urlencoded" + Chr(10) + Chr(13)

'Post the data
Web.Navigate2 "", 0, "", varPostData, strHeader
End Sub

I get the error Sub or Function not defined on "BuildPostData bytpostdata(), strPostData".

This is actually sample code i got from

Any suggestion will be appreciated.


Error 5003 Driving Me Crazy, New, Please Help!!
Hi, i am new at this stuff, anyone help please.
Have old Win98SE with very small 2GB hard drive,internet and broadband, enjoy surfing etc,, recently downloading prog, cant remember which one in particular, but must have deleted a number of files by mistake after rebooting my computer, it went haywire, and the only way to use it was to reinstall over the current install, as it would not load C drive at all. Everything then went fine except two programmes that had been running fine until then. I have VB5 and 6, I am not technical so donot understand anything much except, how to reformat. i have DishWasher and hijack This and CW shredder, CW shredder runs fine but the other two progs give the error 5003. I tried reinstalling VB6 even using a registry fix, but not sure really what todo, still getting the same message. Please help me before i take to the hammer!!!!

The runtime error 3021 " Either EOF or BOF is true..." is still appearing after much tweaking on my part...

For some reason it can not locate the records in the recordset...but for the life of me I can not tell you is a simple query...

Here is what I have:

VB Code:
Option ExplicitDim conn As ADODB.ConnectionDim rs As ADODB.RecordsetDim modificationsApplied As Boolean Private Function UpdateDBInformation() As Boolean' Do your txtBox error checking here as well...             'we need to check and make sure that the user complete's the appropriate fields'...before continuing! If cmbRepMgr.Text = "" Then    MsgBox "Please select whether your adding a Rep or Manager!", vbInformation, "Rep or Manager?"   cmbRepMgr.SetFocus    Exit FunctionElse    If txtNewRepMgr.Text = "" Then    MsgBox "Please enter the Rep or Manager's name!", vbInformation, "Rep/Manger name?"    txtNewRepMgr.SetFocus    Exit FunctionElseDo Until rs.EOF    If txtNewRepMgr.Text = rs("RepName") Then    ' this person is all ready in the database    MsgBox "This Rep/Manager all ready exists!", vbInformation, "Not New!"    Exit Function    End If    rs.MoveNextLoop     If txtBMgr.Text = "" Then    MsgBox "Please enter their Manager's name!", vbInformation, "Manager's Name?"    txtBMgr.SetFocus    Exit FunctionElse    If cmbDept.Text = "" Then    MsgBox "Please enter the department name!", vbInformation, "Department Name?"   cmbDept.SetFocus   Exit FunctionElse    If txtNewLid.Text = "" Then    MsgBox "Please enter the Rep or Manager's Login ID!", vbInformation, "Login ID?"    txtNewLid.SetFocus    Exit FunctionElse    If cmbShift.Visible = True And cmbShift.Text = "" Then    MsgBox "Please enter the appropriate shift of the Sales Rep!", vbInformation, "Shift?"    cmbShift.SetFocus    Exit FunctionElse    'it is here that the error is referring to...I am trying to add to the record     rs("MgrRep") = cmbRepMgr.Text    rs("LoginID") = txtNewLid.Text    rs("Department") = cmbDept.Text    rs("RepName") = txtNewRepMgr.Text    rs("Manager") = cmbNewMgr.Text    rs("Addedby") = txtMgrAdded.Text    rs("DateAdded") = lblDateAdd.Caption    rs("Shift") = cmbShift.Text        End If    End If        End If            End If                End If                    End If                  ' If we made it this far, everything's okay        modificationsApplied = True        UpdateDBInformation = True    End Function   Private Sub cmdSubmit_Click()If Not UpdateDBInformation Then Exit SubIf modificationsApplied Then    rs.Update    conn.CommitTransElse    conn.RollbackTransEnd If If vbYes = MsgBox("Do you want to submit another Sales Referral?", vbExclamation + vbYesNo, _"Another Sales Referral?") Then    rs.AddNewElse    Unload MeEnd If End Sub Private Sub Form_Activate()Dim strSelect2 As StringSet conn = New ADODB.ConnectionSet rs = New ADODB.Recordset conn.Provider = "Microsoft.Jet.OLEDB.4.0"conn.Open App.Path & "SalesTracking.mdb"conn.BeginTrans strSelect2 = "SELECT * FROM Login"rs.Open strSelect2, conn, adOpenDynamic, adLockOptimistic If (rs.EOF) Then    MsgBox ("No records matching Login")Else    If txtMgrorRep.Text = "Mgr" Then    lblDateAdd.Caption = Date    With cmbRepMgr        .AddItem "Rep"    End WithElse    If txtMgrorRep.Text = "SecMgr" Then       lblDateAdd.Caption = Date        With cmbRepMgr            .AddItem "Rep"            .AddItem "Mgr"        End With    End IfEnd If If rs.RecordCount <> 0 Then    rs.AddNewElse    'do nothing End If modificationsApplied = False End IfEnd Sub
I have been trying to figure this one on my own, but can not seem to get past this error...I know why this error appears but not how to resolve it in this instance!!!

Please help!

ADOC Form Error Driving Me Mad - Please Help
I have built a data form using the adoc wizard. after I have made some changes to make it tidy and added some Masked edit boxes for date formatting I am having a problem.

It works ok, until i add a new record. the new record adds ok, but then when I go to the last record in the recordset i am getting an error message :

'row cannot be located for updating. Some values may have been changed since it was last read'

once this has happened I cannot do anything until the form has been reloaded.
it only happens after I have added a new record to the recordset. I have noticed that my checkboxes (which are set to default 'false' in the jet data file' always appear grey (3rd state) after adding a new record - they should be 'false' but they only go to the default state after the form has been reloaded.
i have tried code to 'cancel,refresh,getcolumns' and 'rebind' the primary recordset but they do not solve the problem. some of them generate their own error message 'not valid in this context'. so now I am stumped.

any help to shed light on this would me much appreciated!

Ahhhh DTS Packages...
Hi All

Has anyone had any problems when running a DTS package it causes the machine to freeze.

There is a lot of data in the table.

I am doing a conversion from Access to SQL Server 7

The two databases are the same with the exception that some of the tables have more fields in them now on the SQL Server version.

i have a problem which is giving me the poos... i have created a database using the following..

RnVersion = 32

Set ItemDatabase = CreateDatabase _ (ItemDatabaseLocation, dbLangGeneral, RnVersion)

when i open the database like so...

Set ItemDatabase = OpenDatabase(ItemDatabaseLocation)

and i go to use the database.. i get a 3420 error message saying object not set or something.. Ahh how do i open a database using the way i have saved it?? Please help anyone!!!

Ahhhh Help ~&gt;.&lt;~ Integer Problem
well i have a label box named label1. When i tried to do this
value=label1.caption + 9000

my value is 90009000 instead of 18000 ?? help =/
thanks in advance

Ahhhh!!! Pulling My Hair Out
ok.. i coded this last week and i swear it worked... now it doesn't.. anyone have any ideas???

This program renames files based on some of our company needs...

it loops through a directory renaming the files... now when I do this

VB Code:
Name lblLocalDir.Caption & "" & lstItem.Text As lblLocalDir.Caption & "" & NewName & ".rpt"

i get a Path/File access error
error # 75

lblLocalDir.caption = "C:
lstItem.Text = "MyReport.rpt"
NewName = "MyReport2.rpt"

ok but when I do this...

VB Code:
Name "C:
eportsMyReport.rpt" As "C:

it works...

and if I make 2 variables and hard code them with the paths.. i can use the NAME function also.. but if I make 2 variables and assign their values from lblLocalDir.caption and the other variables.. i get the same error...


Docking Forms.. Ahhhh
hey, this is very hard to me and any gurus i have asked.

I have NORMAL forms, and (Not MDI forms)

and i need multiple forms to dock to one MAIN form.

I've seen examples that docks a form into a picturebox position.. This would be good.. so.. here is what is needed:

You can dock say, 3 forms to the MAIN form. any way you wish
so you can do:

MAIN FORM: (The numbers are DOCKED forms)
Where it says original window here, that just means that you can see any thing that was originally on the form


or you can do

or what ever you decide.

And these are not "SNAPPED" to the side of the form, but docked inside like VB does.

can anyone do this?

Easy Xor Problem.. Please Help! Ahhhh
Hi Everyone!
I have a problem.. I need to perform a Logitudinal Redundancy Check (LRC) on a message which i am sending through the com port. The requirements are that all messages must end in a 1 byte checksum which is appended to the packet following the chr$(3) or (ETX) byte. The LCR is an XOR of all bytes including the ETX itself.

Here's the problem.. I can do all the xor functions except for the chr$(3) part. I need to be able to perform the xor function on this otherwise the receiving end will assume something has happened and must be resent. Which is what it is telling me...

i will be sending this :

"12"+ chr$(3) + LCR

This is what i have so far:

dim LCR as variant

LCR = 0
LCR = LCR xor 1
LCR = LCR xor 2
LCR = LCR xor chr$(3) <-- this is the problem

can anyone help me please! Need help ASAP!!!!

Very Easy Question! Help!! Ahhhh
How do i communicate with a com port? How do i know when something is being received. How do i do this using objects in vb?? Please Help! I know the baud rate which is 9600.. and i know the com port.

Copyright 2005-08, All rights reserved