vb6

ADO showing "hidden columns" with SQL Native Client

I'm working on a legacy application using VB6 and Classic ASP. We're using disconnected ADO recordsets to pass data back and forth. Normally this works. But what has started happening recently is for any inner/outer join, ADO is including these in the available records to choose from. So when were specifying a column to update (in th...

Why is it bad practice to call an eventhandler from code?

Say you have a menu item and a button that do the same task. Why is it bad practice to put the code for the task into one control's action event and then make a call to that event from the other control? Delphi allows this as does vb6 but realbasic doesn't and says you should put the code into a method that is then called by both the me...

What is a better way to implement a simple database select/update program in vb6?

ok here's the rhubarb - I'm working on an application that has been written in VB6 (in which I have less than 1 month's experience), and the gist of the application is it's a simple database select/update type of app. Basically all it does is you can search for employees (selecting the record from the database), and edit their data (and...

VB6 Inet control: possible to not use IE cookies?

Hello I'm using the standard VB6 internet transfer control (Inet). A great feature of it is that it uses IE cookies, so it is possible to authenticate into a website using IE. I can then use my app to download authenticated pages. However, is it possible to do the opposite, to get the control to ignore any IE cookies? ...

How does one distinguish between VB5 and VB6 projects?

I have to maintain a number of minor legacy apps and most of them have no or minimal documentation. There are a couple of these which were written either in VB5 or 6, but I can't tell which. There doesn't seem to be big difference in the appearance of the source code, and I can load either one using VB6, and even run them in the IDE, b...

Attribute VB_VarUserMemID in VB6 source files

I'm reviewing some legacy VB6 code using WordPad (since I don't have VB6 installed). After many of the variable declarations at the module level, I see a second line that sets some sort of attribute for the variable, as shown in the example below. It appears that the attribute number, 1073741852, is the same for all of the declarations...

Passing multi-dimensional variant array from a .Net web service to Classic vb

I am converting a SOAP toolkit 3 Vb web service to a .Net web service. I have a requirement where in I want to pass a two dimensional variant array to vb client. I tried the following 1. I looked into the xml produced by the SOAP toolkit 3 for the vb web serive and tried to produce the exact same xml as vb produced in the .Net web servi...

ActiveX cannot create object vb6 application with crystal report8.5

I inherited a program from my late dad its developed with vb6 and has sql server 2000 as the back end. when i try to print a report from the application it gives the error message "ActiveX cannot create object" but when i view the report from crytal report it displays everything. Please i need help ...

How to Generate an E-mail Message in Microsoft Outlook Outbox in VB6?

I need to send e-mails from my application. But, instead of sending the e-mails directly from through SMTP, I'd like to send it through Microsoft Outlook. So... How to Generate an E-mail Message in Microsoft Outlook Outbox in VB6? ...

User Defined Type (UDT) As Parameter In Public Sub In Class Module.Visual Basic 6

I've tried to solve this problem, but can't find any solution. I have a UDT defined in a normal module, and wanted to use it as parameter in a Public Sub in a Class module. I then get a compile error: Quote: Only public user defined types defined in public oject modules can be used as parameters or return type for public procedures of ...

What is the equivalent C# 3.0 Linq to SQL for this?

Old VB6 Code that needs to be converted: 'DB Connection Set Conn = New ADODB.Connection Conn.ConnectionString = sConn Conn.Open sConn Conn.BeginTrans 'Recordset Set rsPrice = New ADODB.Recordset rsPrice.CursorLocation = adUseClient rsPrice.CursorType = adOpenKeyset rsPrice.LockType = adLockBatchOptimistic rsPrice.ActiveConnection = Con...

SendMessage from VB6 app to Excel dialog box

My employer has purchased a third-party tool, OfficeConverter from Conveter Technology that automates the conversion / repair of Office 2003-formatted files to Office 2007 format. This tool also highly automates the translation / change in macro / VBA code requirements between Office 2003 and 2007 formats. My problem is that during thi...

App.PrevInstance not refreshing itself

I am trying to check to see whether another instance of the application is already running. If it does, I want to keep on checking for another 15 seconds or so before going on... if App.PrevInstance then dim dtStart as date dtStart = now do while datediff("s", dtStart, Now) < 15 Sleep 1000 ' sleep for a second if not...

VB6 auto completion (intellisense) is suddenly taking forever...

VB6 just added a new "feature" right out of the blue: every time I declare a variable, property or function, when I reach the "as" keyword, VB has a fit and hogs the cpu for almost a minute. Anyone knows what this might be? I turned off all plugins (AxTools, MzTools), restarted VB, rebooted, and still nothing. This is incredibly annoyi...

I'm missing the References option in Project menu in VB 6.0

For the past year I've been working on some legacy code that was written in VB 6.0. Sometime in the last couple of days the "References" menu item disappeared from the Project menu drop-down on the menu bar. I've been using this version of the VB studio for the past year without any problems. The only thing that has changed recently is t...

Handle empty recordset in Visual Basic 6

How can I handle the case when the following statement returns nothing, i.e. a non-existing record? Form1.data1.RecordSource = "SELECT * " _ & "FROM Table " _ & "WHERE Column1 = " & txtSomeTextField.Text & "" Form1.data1.Refresh Edit: The error I get is: Run-time error '3021': ...

Attached SQL 2000 DB in a SQL 2005 Server, Now getting VB6 App throwing errors

A SQL 2000 db was detached, SQL 2000 was uninstalled. Then SQL 2005 installed in the same machine. Then the database was attached to the newly installed SQL 2005 server. It seemed to work at first but after the users started to poke around, error related to null started to pop. Null values from datetime columns that DID NOT have nulls, a...

How could I rewrite this to remove the gotos without loss of speed or readability?

I wrote this. Yes, I know it's VB6. Yes, it is production code, and, yeah, I know it uses gotos. I am a lazy, evil beast ... So show me (and the rest of us) how it should be written Public Function SplitString(ByVal sText As Variant) As Variant Dim nHere As Long Dim cHere As String * 1 Dim aRes As Variant Dim nRes As L...

How do I align text in comboboxes in VB6?

Fairly straight forward question, is it possible to align text (left, right, center etc...) in comboboxes in VB6? If so, how? When the text is longer than the width of a combobox, what is shown of the text starts somewhere in the middle of the text. ...

How to Find Record Set Value is Number or String?

Original: Using VB6 If rsCardEvent(4).Value = Str Then TimOut = rsCardEvent(4) Else TimeOut = Left(TimOut, 2) & ":" & Mid(TimOut, 3, 2) & ":" & Right(TimOut, 2) End If Getting Type MisMatch Error. How To Find Record Set Value is String or Number Exactly i need If Number means print number like Time Format (HH:MM:SS...