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

Error Message: Invalid Database Format ???!!!???

Help, I am trying to create a cd database with a vb user interface but when I put in a data control and link it to the database I have created, and then try to run the program it gives me the error message of "invalid database format". I am using MS Access from Office XP and Visual Basic 6.0. I have checked that vb program knows it is an Access database, but am pulling out my hair trying to work out what has gone wrong.

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
" Unrecognized Database Format 'xxx.mdb' " Error Message.....
Hello All,

I know this issue has be addressed a gazillion times in the past, but
none of the offered solutions seem to work for me.

I get this error when I attempt to pull down the RecordSource option
in my GUI. Does anyone have any ideas on how I can solve this?

I am running VB 6 with Service Pack 5 and Access 2000 (9.0.2720)

In advance, thanks so much,


Invalid Database Format Errors

I'm trying to maintain an old program which is not of my design, which until recently was using DAO to access several mdbs.

I've recently changed it so that most of the mdbs have been merged into one (there was no need for several) and also changed it so that every access to that merged mdb is done with ADO.

My problem is that before I did this, one of the databases would occasionally (and randomly) corrupt with an "Invalid Database Format" error, and would require a repair.

As I was converting the application, form by form, I noticed that only the remaining DAO areas were causing this error. However, now that it's all ADO, it's still happening!!

It's all been compiled with DAC 2.7.

It isn't related to any specific form, or any specific computer, or time of day, or anything that I can see.

Any ideas please?



Invalid Password Error Message!

I'm using the following code to access a password protected database but getting the subject message, can you please help me with the syntax, I'm using DAO 2.5/3.51 compatibility library. Tried changing to DAO 3.60 but still getting the same error message.

 Set db = ws.OpenDatabase(App.Path & "aopt1", False, False, "MS Access; PWD=psswd")
, but when running VB, I'm getting an "invalid password" error message.


Error: Invalid Format!
Have an error: says that my file is corrupt and must reinstall the program. Weird thing is... it works in Windows 2000!!!

Will give further details...

Object Library Invalid Error Message

I have an excel application with VB bas and cls modules behind it. It was working fine until I edited it by making few lines of code changes and all of a sudden I am getting the error message "OBJECT LIBRARY INVALID OR CONTAINS REFERENCES TO OBJECT DEFINITIONS THAT COULD NOT BE FOUND". I checked the references and it looks fine and its not missing any reference ( I didn't change anything from the working version). I am not sure what's causing this error.

Any help will be greatly appreciated.

Invalid File Format Error When Creating EXE
I am using two active X controls, CommonDialog 6 and MS FlexGrid. The program complies, but will not produce an exe. When it goes to make the exe, an error occurs...."Invalid File Format".

Any Suggestions...

This is using VB 6.0.

Winsock Error Message: Invalid Operation At Current State!!
what is the meaning of this error message : Invalid operation at current state??

How To Display The Crystal Report 11 Using VB6.0 - Error Message Invalid TLV Record ...
Hello VB & CR users,

I have upgraded my Crystal Report 8.5 to 11. I know how to use CR 11.0
with VB.NET.

But one of my applications is still using VB 6.0 but I want to upgrade
all the reports to 11.0. I have added the "Component ->Crystal Activex
Report viewer library 11.0" and named crviewer1. Using below method
previous 8.5 reports displays correctly but the new report which is
creates using 11.0 gives message "Invalid TLV record". Please anyone
guide me here what else is required or which is correct code for the
below procedure????

ReportName = NPath & "oilcustomer.rpt"
Set CrxReport =
CrxReport.VerifyOnEveryPrint = True
For i = 1 To CrxReport.Database.Tables.Count
Set CRTABLE = CrxReport.Database.Tables.Item(1)
CRTABLE.SetLogOnInfo "ServerName", DatabaseName", "Username",
Next i
CrxReport.DisplayProgressDialog = True
CrxReport.VerifyOnEveryPrint = True
CrxReport.UseIndexForSpeed = True
CRViewer1.ReportSource = CrxReport


How To Toss An Error Message For An Invalid ActiveX Control Property Assignment?
Hi, there
I am working on an VB activeX control. In the "Let" functions of my control's properties, I'd like to report those invalid assignment. For example, if the user assigned a negative value to a property which only accepts positive value, I would like VB to pop up a message box with a red cross in it and carries the error message defined by me. I know how to achieve it with ATL control, but I don't know how with VB activeX control. Please advise and thanks in advance...

ODBC Error Invalid Date Format VB6/MS SQL 2000/Crystal 8.5
Hi All,

I wrote and compiled a number of programs in VB6 that take data from an SQL 2000 database and using Crystal 8.5 produce reports.

I installed the reports onto several user machines and after some problems with dll's got them working.

I am now trying to install onto another machine and get the error:
"ODBC Error {microsoft}[ODBC SQL Server Driver] invalid date format"
when I test the reports.

I have checked the ODBC settings and they are identical to the machines that are working ok. (Use regional settings is not ticked).

If we install Crystal Reports onto the machine it produces the reports without any problems but when we take it off the reports stop working so I'm reasonably confident that it is not a coding issue.

Has anyone experienced anything similar that could throw some light on the problem?



Format Function Error - "Wrong Number Of Arguments Or Invalid Property Assignment"

I have searched google and this board but am unable to solve this issue. I am getting this error on the ".FrameProgress.Caption" line. Why am I getting this error? I have other procedures using Format and it works while I am getting this error on other Format functions.

This is VBA in excel XP

Sub UpdatePBar(pctDone As Single, Optional Cap As String)

With pBar

If Cap <> "" Then
.lbStatus = Cap
End If

.FrameProgress.Caption = Format(pctDone, "0%")
.LabelProgress.Width = pctDone * (.FrameProgress.Width - 10)
End With
' The DoEvents allows the userform to update
End Sub


Error: Unregconize Database Format After Convert Database
previously i design my database using Data Manager. after that i wish to set password to the database using Access 2000, but the 'Set Database Password' is disabled. So i convert the database to current database, then i can set the password.

BUT, i come back to my program, all Data Control cannot be refresh. an error says "Unregconize database format....". After sometime of exploring, i change the Connect property from Access to Access 2000, now it can run properly.

BUT, after i compile the program, make a setup package, and reinstall to other PCs, some PC can work but some PC give Error 3170 - Could not find installable ISAM.

anyone can advise?

how can i remain the Data Control's Connect property to Access, so that other PCs can work properly? is it i must convert the database using Access below 2000?

please advise. thank you.

"Invalid Data Format" Error
Hi I've been working on VB project for the last little while and all of a sudden when I loaded it I get an "Invalid Data Format" error.

This error occurs when I load the project, I can see my forms but I can't access the code and I can't change my references or the error appears again. I believe the error is some sort of reference error but I can't do anything inside VB without getting an error message. I've tried exporting my forms but it doesn't work. I need help!


Error Message In Database Setup
Why do I get an error on the bold area of this. Thank you.


Private Sub Form_Load()
Dim MyData As ADODB.Connection
Set MyData = New ADODB.Connection
MyData.ConnectString = "Provider=Microsoft.Jet.OLEDB.3.51;"
Dim dbPath As String
dbPath = "app.path & BibleKJV.mdb"
MyData.Open dbPath

End Sub

Urg?? How To Extract Actual Message Body From Multi-part Message In MIME Format?????

iam doing an pop3 email application.

iam able to download the email messages,delete the messages from the server permanently.

iam able to read the whole mail into a rtf text box(actual idea is to display the body part).

the content what i displayed in the rtf text box is shown below..

please go through this as it will help you to suggest me answer
Return-Path: <>
Received: from varma ( [])
by (8.11.2/8.11.2) with SMTP id gAL9YTC20986
for <>; Thu, 21 Nov 2002 15:04:29 +0530
Message-ID: <003001c29140$0c7a47b0$8301a8c0@varma>
From: "vijay varma" <>
To: "vijay varma" <>
Subject: KJKL
Date: Thu, 21 Nov 2002 14:56:19 +0530
MIME-Version: 1.0
Content-Type: multipart/alternative;
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Status: O

This is a multi-part message in MIME format.

Content-Type: text/plain;
Content-Transfer-Encoding: quoted-printable


Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.422 / Virus Database: 237 - Release Date: 11/20/2002

Content-Type: text/html;
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<META http-equiv=3DContent-Type content=3D"text/html; =
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>LKJL</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><BR>---<BR>Outgoing mail is certified =
Free.<BR>Checked by AVG anti-virus system (<A=20
href=3D""></A>).<BR>Version: =
6.0.422 /=20
Virus Database: 237 - Release Date: =


but i want to parse and get the actual body from the mail message.

is there any way to parse and get the actual content???

please suggest me any examples.....

Error Message "the Database Engine Could Not Lock...
when clicking on the button the code runs fine the first time, adding a user to a database, though when executed again i recieve the error:

"The database engine could not lock <table> because it is already in use by another person or process."

when i close the form and reopen it, i am able to click the button once with success but on the second click i still recieve the error noted above

here is my code:

Public Sub Enter_User_Click()
On Error GoTo Error_Handling

'turning the warnings off
DoCmd.SetWarnings False

'setting the focus

'getting nt userid entered into the textbox
stringUser = username1.Text

'checking stringUser
If stringUser = "" Then
'error message
MsgBox "NT user identification not valid, please enter a valid username.", vbOKOnly, "Osare"
'emptying the boxes
Exit Sub
End If

'opening Osare_Databases and creating a column with user's NT id
DoCmd.RunSQL "ALTER TABLE Osare_Databases ADD COLUMN " & stringUser & " varchar(20);"

'opening Osare_User and entering id information
DoCmd.RunSQL "INSERT INTO Osare_User ([Userid]) VALUES (stringUser);"

'opening Osare_User and updating admin information
DoCmd.RunSQL "UPDATE Osare_User SET Admin = 'no' WHERE Userid = stringUser ;"

'refreshing the combobox

'emptying the boxes

'adding information to the log file
stringLogInfo = "user: " & stringCurrentUser & " added a user to the Osare user list"
Log_Info (stringLogInfo)

End Sub

important info:
Log_Info and Empty_Boxes are other methods
the variables i use here are declared globally

any clues on how to fix this error??? perhaps i should close the table at the end of each event... help!!


Database Format And Error Questions
i am getting a run time error on 1 of my 8 flex grids i'm running in a pharmacy software program.

1 table has all the drugs etc etc
1 table is a patient info set
1 table is a patient profile

basically, i have it so you double click on the patient info set to get a more detailed vew and a patient profile.

basically structure of patient profile is this:
profile_ID: autoincrement to individualize each record
patient_ID: same as one used to id patient in patient info set
drug_ID: same as one used to id drug that they are on

everytime a new drug is added to the patient profile, it gets a new profile_ID and a new drug_ID(corresponding to the drug added). the thing that remains the same(or similar) is the patient_ID.

the table for the patient profile in the more detailed view gives me run time error 30023, saying the datasource is screwed basically.

i am running:

thatsql= SELECT * FROM ptprofile WHERE patient_ID= X
set rsPTPROFILE = new adodb.recordset
set rsPTPROFILE=myconnection.execute(thatsql)
set adcProfile.recordset = rsPTPROFILE
set FLEXGRID.datasource=adcProfile

do you see anything wrong with this thought process? is there an easier way to do it? why on running does it not work?

just fyi, the rs is FINE, i linked a textbox to it just to see if it will work, and the textbox datafield="drug_ID" with move nexts and stuff it runs right through the guys profile. grrrrr

thanks in advance

Unrecognized Database Format Error
I am migrating an old Visual Basic application that used Access 97 to one that will use Access 2002.

I have the application working in almost every area except one:

When i open one of the windows, i get an error saying "Unrecognized Database Format 'C:XXXXXX'. (XXXXX is just the path on my particular Computer) All other windows, open the database and have no problems adding or deleting from the access database.

If you click OK on the Error message box, it brings up a Run-time Error '91' Object variable or with block variable not set.

I was having a problem before with my DAO.DBEngine control. I fixed those, but it seemed like something there may have still been effecting different areas. Could it just be that i am missing a component or reference???

If anyone has any ideas on what my problem is and how to correct it, that would be greatly appreciated.

Unrecognized Database Format Error In VB
hi have made a table on MS Access 2002 and then on vb i added the data control button and tried to link it to my database in access using the databaseName in the properties section. I added text boxes so that all the fields from the MS access db can appear on the vb program in the textboxes
when i run the program this message appears
unrecognized database format ................(where its located)
i think its to do with connect in the properties section
at the momenty it only says Acesss but it should say Access 2002
I am using Visual Basic Enterprise Edition 6.0
wat may b the problem?
pls can anyone help

Unrecognized Database Format Error

I converted form ACCES 97 to 2000, now when I try to run the program, I get the subject error
message, can you please help me solve this problem.


Unrecognised Database Format Error!
I am using ms access2000 database for vb6.Everytime I try to connect to the database through visual data manager it gives me an error "unrecognised database format number 3343".To solve this problem I downloaded service pack4 and followed all the instructions given here
Still my problem remains the same.What else I am supposed to do to solve this problem.Please Help!!!!!!

Error 3343: Unrecogised DataBase Format
I am a VB5 beginner trying to connect my project to my Acces97 (mdb) database. I keep getting the above error. Changing the References in the VB5 proramme does not help (tried MS DAO 3.51, MS Access 8 and 9). The Database is not corrupt in any way. The database is simple (6 Tables).  I do not wish to use the Data Control for the purpose. So need to create classes.

Any ideas would help heaps on the connectivity issue and code which will get me started.



"Unrecognized Database Format" Error After Compacting The Access Database.
Urgent..Need help.

I am using VB 5.0 with Access97 database. I am using the following code in vb5.0, to compact access 97 database. It compacts successfully.
But after compacting when I access that database, it throws and error message "unrecognized database format"

I am having "Microsoft scripting runtime", "Microsoft Jet and scripting replication objects 2.6" references added to the project.

Private Sub CompactMDB(MDBfilename As String) 'filename can include full path
Dim vJet As New JRO.JetEngine
Dim vBak As String
Dim vBackup As String
Dim vSource As String

'if backup already exists, kill it
vBak = Left(MDBfilename, InStr(MDBfilename, ".")) & "bak"

Set fso = CreateObject("Scripting.FileSystemObject")

If fso.FileExists(vBak) Then
Kill vBak
End If

Set fso = Nothing

'set datasource
vSource = "Data Source=" & MDBfilename & ";Jet OLEDBatabase Password="
vBackup = "Data Source=" & vBak & ";Jet OLEDBatabase Password=" 'you can change the password
'vSource = "Data Source=" & MDBfilename
'vBackup = "Data Source=" & vBak 'you can change the password

'compact/repair & backup
vJet.CompactDatabase vSource, vBackup 'compacts to a backup file

Kill MDBfilename 'kills original mdb
FileCopy vBak, MDBfilename 'copy bak to mdb
End Sub

Help:Unrecognized Database Format Error With Access 2000 From Vb 6.0
I tried to work from vb 6.0 connects to database in Access 2000, gets error "Unrecognized database format", but I have no problem with lower access versions, like 1997. Any idea or help will be greatly appreciated. thanks in advance!


Error: "Unrecognized Database Format &lt;db Path Goes Here&gt;
Using VB6...When I run the application wizard I keep getting this unrecognized database format error. The database was created in Access XP.

I suspect VB6 is too old and does not recognize the new Access XP database but do not know this to be a fact.

Any ideas on how to get VB6 to accept this database?

Thank you.


Everything should be made as simple as possible, but not simpler
--Albert Einstein

Intermittent Unrecognized Database Format Error Due To Same Table
I have a network shared Access 2002 .mde secured database with a VB6 front end

Occasionally I get an error of Unrecognized database format where a user cannot access a certain table (always the same table) Although other users can continue to access that table.

When everybody closes their database connection, they then get the Unrecognized database format error when they try to logon again.

I try to compact and repair using the code below but this fails

I open the database using Access XP direct and it asks if I want to repair the database. I click yes and it is repairs ok. Everybody can now access it ok

What is different from Access XP running the repair and my code below?

What would cause a table to be Unrecognized database format for one user trying to open a recordset, while others can access ok until they logoff?

I keep the connection object always open while the application is running and close only when the application is ended.

    DBPROVIDER = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & gsQADMmdbPath & gsMDBFileName & ";"
    SYSTEMPROVIDER = "Jet OLEDB:System Database=" & gsQADMmdbPath & gsWGFileName & ";"
    DBSECURITY = "Persist Security Info=false;User Id=" & txtUserName.Text & ";"
    DBMODE = "Mode=" & adModeShareExclusive

    je.CompactDatabase DBPROVIDER & SYSTEMPROVIDER & _
                            DBSECURITY & "Password=" & sPassword & ";" & DBMODE & ";", _
                            "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                                "Data Source=" & sTempFile & ";" & _
                                    "Jet OLEDB:Encrypt Database=True"

Hope someone can help as this is becoming a regular occurrence now




Probs With Access 2000-unrecognized Database Format Error!!
Hi. I'm trying to make a simple application using VB 6.0 and Access 2000. My problem is that when i try to connect to Access 2000 databases using a data control i get an 'unrecognized database format' error. This doesn't happen when i connect to databases created in an older version of Access. Anyone know how to solve this problem??

Message Box For Invalid Data
hi peeps

i was wondering if anyhere can help me with this...

i want a message to appear by clicking froma text box.
the message box shoud appear if the data in the text is not numerical values.

for instant if they put "hello" in the text box and clicked on the command button a message box should show, showing "input numerical values only"

thanks people.

p.s do uahve to declare the variable to single or wot?

HELP!!! Invalid Use Of Property Message
On the combo box I changed the :
Private Sub CBOlocationtype_Change()
Private Sub CBOlocationtype_Click()
this is what follows (just in case)
If Me.CBOlocationtype = "Normal" Then
Me.CBOlocationtype1.Visible = True
Me.CBOlocationtype2.Visible = False
Me.CBOlocationtype2 Visible = True
Me.CBOlocationtype1 Visible = False
End If

But when I run it to check I get "Invalid use of property" message

I Got Message Invalid Password.
Well i have setted database password as "Admin"
-when i run the code below, it gives "Invalid Password"
-how this happened please help me

private sub cmdAdd()
' all the variables are declared in the module
  strDB = App.Path & "Data" & "data.mdb"
    strConn = "Provider=Microsoft.JET.OLEDB.4.0;Data Source=" & strDB
    conS.Open strConn, "Admin"
    recS.Open "products", conS, adOpenKeyset, adLockOptimistic
    recS("ItemCode") = txtItemcode.Text
    recS("ProductName") = txtProductname.Text
    recS("Description") = txtProdescription.Text
    recS("Dimension") = txtProdimension.Text
    recS("UnitPrice") = txtProuprice.Text
    recS("Stock") = txtStock.Text
    recS("Date") = txtDatearrived.Text
    recS("Vendor") = txtVendor.Text
    Set recS = Nothing
    Set conS = Nothing
end sub


Sabin Kumar Chhetri

Invalid Format After Compiling!
After compiling my project (successfully I might add), the exe doesn't run. It gives me an invalid format error and tells me that the file is corrupt! It runs great when I'm designing, it just screws up when I compile...

Any help would be great...

Invalid Format For Icons
Somebody please tell me I'm brain dead. Is there a certain format that VB requires for its icon format? I've tried creating several icons in several formats but no go. I've even tried using Windows system icons. VB keeps telling me that the icon is an invalid format. Whats up?

Invalid File Format Problem
I developed a small application about a year ago in VB 6 that queried an Access db. The OS was NT4. I used the Data Environment designer to access the database.

I've recently had to revisit the application on a Win2K machine to make a very small change. The app works fine when I test and run it in design mode. However when I build the exe and run it I get the error message:

Run-time error '321':
Invalid file format

Not being an expert at this sort of stuff I guess I'm missing some sort of run time library or something. The error occurs as soon as I try and open a recordset in the DE

Anybody got any ideas?

Spanish Error Message To English Error Message?
Hi all,

My colleague in Spain has written a VB program years ago and now I have to take over it. However, I need to modify it but when I get an error message, it comes out with Spanish message. Is it possible to convert it back to English version?

Thank you!

Data Control Error "unrecognised Database Format" On A2K DB
I am trying to use the data control in VB6 to open a A2K database but I get the message
"Unrecognised database format". I'm sure I can change it with the references but I have tried this and failed.

Help appreciated

"Unrecognized Database Format" Error
Hi guys..

I tried accessing my database(Access) from VB using the Data property. I tried setting the record set but it gave me the "Unrecognized Database Format"..When i tried another database (samples from Access), it was ok...

Please help..


Error "Unrecognized Database Format"
I am creating a program that can access with database.
I have created a data base file on MS Access. (I have attached it with this forum)
So I have drawn a data control on the form.
And set the database name.
But when I set the property of record source, this message is appearing.
“Unrecognized database format [database filename with URL]”
What is the problem in my project?

Error "Unrecognized Database Format"
In VB when setting the properties for the recordSource I get the following error.

"Unrecognized database format"

The Access mdb was created with Access 2000 and I am running Microsoft DAO 3.6 object librery.

When I run the example Access database that is provided by microsoft it works perfectly.

The Access mdb that was created in the example was Access 97, running Microsoft DAO 3.51 object librery.

Why does mine not work and what can I do to fix the problem?

I appreciate any help.

Error "Unrecognized Database Format"
In VB when setting the properties for the recordSource I get the following error.

"Unrecognized database format"

The Access mdb was created with Access 2000 and I am running Microsoft DAO 3.6 object librery.

When I run the example Access database that is provided by microsoft it works perfectly.

The Access mdb that was created in the example was Access 97, running Microsoft DAO 3.51 object librery.

Why does mine not work and what can I do to fix the problem?

I appreciate any help.

Create Package Error; "Unexpected Error Number 380 Has Occured;invalid Property Value
Hi all,

I try to create a package in visual basic; However, I found the following error. "Unexpected error number380 has occured; Invalid property value". My development environment ,
OS: Win2000
VB: Visual Basic 6.0

Thanks a lot .

Edward Hui

Message Box Format
hey, i was wondering if i could give a background color or a background img and select font and caption and stuff in a msgbox... Is there any way to do this or any other formatting?

msgbox "Thanks!"

Message Format
I have the following problem :

I created a DLL with VB - add-in - which On_click opens a winsock telnet on port 143 which establishes a session with my imap server to get certain message(s).
The problem is that the message i get from my telnet session can be seen only as txt format and doesn't suppport any other format.
My question is :
How can I call outlook from VB to handle my message gottten from imap session ???

Thanks in Advance

Edited by - userNamemarco on 11/9/2003 9:59:05 AM

Error Sending Message Throw CDO.message
I've been trying to build a program that sends emails without the OCX control MAPI.
CDO collection object was my election.
It works properlly on most of cases, but in some of them the following error ocurs:

Run-time error '-2147220975 (80040211)':

The message could not be sent to the SMTP server. The transport error code was 0x800ccc15. The server response was not available.

Has anyone any idea. What going on?? im quite desperate, i'll be really glad if you could help me.

Format Message Box Text
Given the following message box statement:
Msgbox “Hey Man”
I want to separate the words into 2 lines.

The following can be used to separates lines in the prompt:
carriage return character (Chr(13))
linefeed character (Chr(10))
carriage return–linefeed character combination (Chr(13) & Chr(10))

Problem is, how do I implement them? (Syntax-wise)
And which one do I use (and why?)

Converting Message From EML To MSG Format
Hi everyone,

I have a problem about email message format converting.
I want to write a program in VB.NET to convert the EML format email message
to MSG format, does anyone knows how to do it?
If you know it you can send me a message to Join Bytes!

Thanks at all.

Invalid Qualifier Error ??? And Undefined Variable Error ???
Private Sub Form_Load()
If GetSetting(App.Title, "Startup", "counter", "") = "" Then
SaveSetting App.Title, "Startup", "counter", 1
SaveSetting App.Title, "Startup", "Started", Format(Date, "mm dd yyyy")
SaveSetting App.Title, "Startup", "Last Used", Format(Date, "mm dd yyyy")
lblcnt.Caption = "1"

for some reason when i compile my app, i get this error invalid qualifier at lblcnt <<
can anyone fix this? it bcuz of this

Dim lblcnt As String

but b4 i put Dim lblcnt As String at the was having an undefined variable error

Outlook Mail Message Format/VBA
I would like to send my messages in html or something else rather than in Rich Text which seems to be the default. My settings in Outlook show HTML.

Any help would be grateful.

Here's my code:
Public Function Emailer(ccode, coname, emailto)
Dim objOutlook As Object
Dim objMailMessage As Outlook.MailItem

Set objOutlook = CreateObject("Outlook.Application")
Set objMailMessage = objOutlook.CreateItem(0) ' 0 = MailItem.

With objMailMessage
.To = emailto 'Email address of recipient
.Subject = ccode & " - " & coname
End With

Set objMailMessage = Nothing
Set objOutlook = Nothing

End Function

Compile Error: Invalid Qualifier Error
Hi all

Just joined the forum looks very active (which is good).

After using MS Access for a few years, I thought it was time to learn VB and have started with VB6. After scrouging up a few books to use, I decided on the VB6 Bible from IDG books to start off with. So off I went working through the examples for creating a form etc. And came up with a problem....

the code...


Option Explicit
Private dbPrimary As Database
Private rsListData As Recordset
Private frmMDIRef As MDIForm

Public Sub Display(dbinput As Database, frmParent As MDIForm, sDataType As String)

Dim itemReturned As ListItem
Dim fldloop As Field
Dim i As Integer

Set dbPrimary = dbinput
Set frmMDIRef = frmParent
Me.Caption = sDataType
Set rsListData = dbPrimary.OpenRecordset("qryList" & fnRemoveSpaces(sDataType).dbOpenDynaset, dbSeeChanges)

ctlListView.View = lvwReport
ctlListView.Sorted = True
For i = 1 To rsListData.Fields.Count - 1
ctlListView.ColumnHeaders.Add "Column" & rstlistdata.Fields(i).Name
Next i
Do While Not rstlistdata.EOF
Set itemReturned = ctlListView.ListItems.Add( _
, _
"Item" & rsListData.Fields(0), _
For i = 2 To rsListData.Fields.Count - 1
itemReturned.SubItems(i - 1) = rsListData.Fields(i) & ""
Next i

End Sub

Private Function fnRemoveSpaces(sInput As String) As String
Dim sTmp As String
Dim i As Integer

For i = 1 To Len(sInput)
If Mid$(sInput, i, 1) <> "" Then
sTmp = sTmp & Mid$(sInput, i, 1)
End If
Next i
fnRemoveSpaces = sTmp

End Function
It errors with "Compile Error: Invalid qualifier" error on the section


I've looked everywhere and can't find anything that might help me out hence the post.

Anyone have any ideas (remembering I'm a beginner)



UserControl ( Object Not Set - Error 91 And Invalid Use Error )
Hello all, ( two questions )

I have an user control that I am using that I got from the following URL. Http:// When I use the UserControl an an OCX ActiveX control ( correct me if I am wrong on the definition ). The author was very nice and included the source file with the package, a CTL file. I am now trying to just add the UserControl to my project so that I don't have to worry about distribute any OCX file and registering it ( because I don't know how to test for it and install one from the VB program level ).

Ok, so I have a few problems. Since going the include with my project route, I have now lost properties Top, Left, Width, Height, Move and Visible. Since I never wrote a UserControl and only have written once class before I took what he had and put in what I think should be there, maybe you can tell me. The main control in the UserControl is a picture with a name 'picStatus' So I have inserted some properties so I can access them in my program since they didn't show up after I pressed the dot '.' after the variable name.

public property let Visible(byval bVisible as Boolean)
picStatus.Visible = bVisible
End property

public property get Visible() as Boolean
Visible = picStatus.Visible
End property

public property let Move(byval lLeft as Single, _
byval lTop as Single, _
byval lWidth as Single, _
byval lHeight as Single)

picStatus.Move lLeft, lTop, lWidth, lHeight
End property

public property get Height() as Long
Height = picStatus.Height
End property

public property let Height(byval New_Height as Long)
picStatus.Height = New_Height
End property

So will that work? The Move command does work when I use the following syntax in my code

pbArchiveLoadStatus.Move tRC.Left, tRC.Top, tRC.Width, tRC.Height

Something about 'Compile Error. Invalid use of property' Oh, I forgot, I define the variable ( or is it an Object or what? ) as following

option Explicit
Dim pbArchiveLoadStatus as vbwProgressBar

Question 2) Another problem I get with this implementation is I get the following error "Run-time error '91': Object variable or With block variable not set". I get this error if I insert any code one of these code snips..

SetParent pbArchiveLoadStatus.hwnd, StatusBar1.hwnd
pbArchiveLoadStatus.Top = tvArchiveListing.Top + tvArchiveListing.Height
pbArchiveLoadStatus.Width = tvArchiveListing.Width + iWIDTH_BETWEEN_CONTROLS

From MS site I find the following definition for this error ( )

You are attempting to use an object variable that is not yet referencing a valid object, or one that has been set to Nothing. Specify or respecify a reference for the object variable. For example, if the Set statement were omitted in the following code, an error would be generated:

Dim MyObject As Object ' Creates object variable.
Set MyObject = Sheets(1) ' Creates valid object reference.
MyCount = MyObject.Count ' Assigns Count value to MyCount.

I am not sure what I am doing wrong. I have tried all kinds of statements using Dim, Set, Private, Public or whatever. Is there a specific way I need to declare a UserControl? Any suggestions? I can send my project upon request. Thanks for the help


Copyright © 2005-08, All rights reserved