vb5prgrmr 143 Posting Virtuoso

Okay, I have read your PM and my code example is the same as the example you have provided (Only my example shows you the root of the object tree, that's all.). Now, have you moved the 3.51 DAO or the 3.6 DAO reference up through the references dialog? So that it is above the ADO reference? Please do that before you retry the code in the link you posted.

Good Luck

vb5prgrmr 143 Posting Virtuoso

I don't see where you set the cr to the database... Ahh there it is at the bottom. Try putting it higher in your code...

Good Luck

vb5prgrmr 143 Posting Virtuoso
vb5prgrmr 143 Posting Virtuoso

That should be either 3.51 or 3.6. Try removing the 3.51, add the 3.6 (DAO) hit ok. Now go back and use the uparrow to make 3.6 the fifth entry...

Dim Db As DAO.Database
Set Db = DBEngine.OpenDatabase("PathFileNameOfDatabaseToOpen")

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well the code provided on that page is DAO and not ADO. So you need to have a reference to DAO. Also, if that little snippit you gave is representive of your actual code, you should be getting an error because of the comma and blank thereafter (Compile Error: Expected Expression)

Good Luck

vb5prgrmr 143 Posting Virtuoso

I thought that might be the problem. Glad you got it solved. Now, if you don't mind could you please mark this thread resolved.

Thanks and Good Luck

vb5prgrmr 143 Posting Virtuoso

Place a breakpoint at the line and hover the mouse over the variable. Do you see if you actually have a full path and file name in the variable? Or goto the immediate window and type in ?gf_strDbPath and hit enter. Does the variable contain a fully qualified path and file name?

Good Luck

vb5prgrmr 143 Posting Virtuoso
Private Sub Command1_Click()
'use common dialog control to allow user the select an image file
    With Dlgs
        .Filter = "(*.bmp;*.jpg;*.gif;*.dat;*.pcx)| " & _
            "*.bmp;*.jpg;*.gif;*.dat;*.pcx|(*.psd)|*.psd|(*.All " & _
            "files)|*.*"
        .ShowOpen

        If .FileName = "" Then Exit Sub

        FN = .FileTitle
        'Open File And Read as Binary (open the file selected by user)
        Open .FileName For Binary Access Read As #1

'create buffer in memory to hold the contents of the file
        FileBinary = Space(LOF(1))

'read the file into the buffer created and close the file
        Get #1, , FileBinary
        Close #1


        'Add File To DB
        rs.AddNew 'tell ado recordset object that you are adding a new record
        rs!Img_name = FN 'set a text field to the file name of the file selected by user
        rs!Image = FileBinary 'set a memo field with the contents of the buffer
        rs.Update 'tell the ado recordset that you want to save the new record

        'Refill List
        GetAllFiles 'unknown proceedure
    End With
End Sub

as for the second piece of code on that page...
query the database, check to see if record found, no>notify user, else>check to see if file exists and delete it if necessary, then save the contents of the memo field to the hard drive and use the load picture function to display the picture into an image control...

Good Luck

vb5prgrmr 143 Posting Virtuoso

You can't! At least not with Visual Basic. You can however with RealBasic...

Good Luck

vb5prgrmr 143 Posting Virtuoso

3 Okay, the MDAC is the Microsoft Data Access Components and yes you need it.
2 Those 3 are one in the same...
1 Yes, as previously stated you need those three files...

Tell users to right click on setup.exe and run as admin or download Windows Installer 1.1 from microsoft or check out the Inno setup for vb 6.0 as these are both free.

Good Luck

pankaj.garg commented: thanks for the inputs +1
vb5prgrmr 143 Posting Virtuoso

Ahhh!!! I see dead threads!!!!

lashatt2,

Please in the future start your own thread and if need be, copy the url into your new thread. And NO, I don't understans so please start your very own thread and if you really need to, copy this threads url into yours.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, there are three files you need to distribute you application. The Cab, the lst, and the exe. (You did create a standandard deployment package, didn't you?) The support directory you do not need to include in your zip, if that is how you are putting you application on the web.

Good Luck

vb5prgrmr 143 Posting Virtuoso

AndreRet,

The code you provided will end the application (if there are only two forms) and I'll tell you why...

When you go Form2.Show vbModal from Form1, code execution stops in Form1 and begins in Form2, because of this, Form1 is now not accessible because Form2 has been shown modal. The only way to have the next line of code execute in form1 is unloading form2 and once you do, Form1 unloads.

vb5prgrmr 143 Posting Virtuoso

Search the web...!!! There are many examples out there!

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, I don't know what kind of code you have in the resize event but here goes...

Option Explicit

Dim BusyResizing As Boolean

Private Sub Form_Resize()
If Me.WindowState = vbMinimized Then Exit Sub
If BusyResizing = True Then Exit Sub 'this prevents reentrancy while user is dragging edge of form
BusyResizing = True
Timer1.Interval = 250 '1/4 second
Timer1.Enabled = False
'do resizing code here
BusyResizing = False
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
Timer1.Enabled = False
GridName.forcecolfit
End Sub

Okay, the logic behind the above is this. The boolean variable keeps the resize event from being entered or reentered (reentrancy) as the user drags the edge of the form. Controlling the timer this way in the hopes that the timer event will only fire after the user has released the edge of the form...

Note: Untested suggestion above

Good Luck

vb5prgrmr 143 Posting Virtuoso

I would check for an interval delay or use a boolean value to prevent the called sub/function from being called repeatedly, or perhaps a timer control would do...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Through emulators, VB 6.0 can run on Linux and Mac but .NET is .NOT on those platforms last I heard.... Okay, .NET can run on Linux... and you have to run a windows OS on a Mac for .NET to run (Quick reads).

As for MySQL or MS's SQL Server, yes both 6.0 and .NET can connect to them.

For scanning, both would be able to scan via a scanner and the WIA 2.0 interface (See MS for WIA 2.0 SDK).

So, in short, both can run on linux and mac but not natively. Each would have to run through some sort of emulation but if you really want to be cross platform independent then see this listing of some of the languages that are capable of this...

http://en.wikipedia.org/wiki/Platform_independent#Cross-platform_development_environments

However, I would suggest that you give realbasic a good look as it is very simular in syntax to 6.0 http://www.realsoftware.com/realbasic/
(see the intro video on any of the pages (personal, professional, studio)


Good Luck

vb5prgrmr 143 Posting Virtuoso

Add a module, and add...

Sub Main()

End Sub

Then add the code you need to inside of sub main but don't forget to put in your Form1.Show or your program will look like it does not even run. Next, GoTo Project>Properties and on the right there is a combo box right under the words "Startup Object:". Select Sub Main and hit OK.

Good Luck

pankaj.garg commented: thanks...this helped.. +1
vb5prgrmr 143 Posting Virtuoso

Wrong forum!!! This is the "CLASSIC" forum! You need the .NET forum!


Sheesh! These up and comming programmers don't even know what language they are using!

vb5prgrmr 143 Posting Virtuoso

abdalla,

You are in the wrong forum! You need the .NET forum! And when you post your question over there, DON'T RAISE THE DEAD! Create your own thread!!!

Damn necrophiliac's :)

Good Luck

Nick Evan commented: agreed && moved +10
vb5prgrmr 143 Posting Virtuoso

In module...

Public Const MyVar As Integer = 5

However, you will not be able to change this value if you are wanting to have this value change.

Now, there is another way if you have your program start up in a sub main...

Option Explicit

Public MyValue As Integer

Sub Main()
MyValue = 5
Form1.Show
End Sub

Good Luck

vb5prgrmr 143 Posting Virtuoso

something like...

If j Mod 42 = 0 Then Me.cls
Print ...

This will clear the form of the printing you have done to it and reset the currentx and currenty properties to 0. Look it up in help to make sure you use it right if you are manipulating the forms autoredraw property.

Good Luck

vb5prgrmr 143 Posting Virtuoso

For connection string information, see http://www.connectionstrings.com. For further support on exposing your server to the internet, see the documentation or MS for further info.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Search the web for watch directory and for a good start look at this thread and follow strongm's links to his code...

http://www.tek-tips.com/viewthread.cfm?qid=1568282&page=1

Good Luck

vb5prgrmr 143 Posting Virtuoso

GoTo the school or public library and watch how the transactions are made. Write down, step by step, how a typical transaction goes. Talk with the employees there and find out the steps they go through for each and every transaction. Then, figure out the five W's. Who, what, when, where, and why. Why is always money spent and saved in labor and equipment. Who is the current employees and how much more productive they can be and perhaps the reduction in labor by X% because of the automation. What has to be done to implement this new system (barcoding books and the initial data entry of current inventory). When is project timeline to completion of each phase of project and how much estimated time it will take to complete each phase.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well since OP does not have the source, the OP cannot check references, and I'm betting that the "Error Creating Letter: Cannot Create Object" is our best clue as to what might be going on. I'll also bet that the system is missing some third party software like Adobe, or Office because of the "Letter" part.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Thanks for the reference AndreRet :)

vb5prgrmr 143 Posting Virtuoso

dajaci, juniorj has the faster and prefered way in which to pull the singular last record from the database as it only requires the program, the network (if on a network), the database, the hard drive(s), to be called only once while your code calls all the above twice and increases not only wear and tear but time.

Good Luck

vb5prgrmr 143 Posting Virtuoso

To begin with, let me reiterate that just because you put a file in the support folder does not mean it will be included with your setup package! You have to manually add the file when creating your setup package and when you do so you have to specify exactly where you want it to be installed! Then if you have hard coded your path to where this file is located in your code and the file is not installed in that exact same place...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Thirdly, how can you call this thread anything to do with visual basic versions 4/5/6 when it contains .NET code???

vb5prgrmr 143 Posting Virtuoso

Either rewrite as an ASP application or convert it to activex.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Abu, I would suggest you start off by getting one of those cheap serial port LED cards and search on the web for it using rs232 (?) cable communications or "vb6 rs232 example"...

http://www.rs232-serial-communications.com/serial-communications-activex.htm

While the above site is selling an activex control, if you scroll down a bit they have an example in vb6 that you can view.

and this one has stuff to sell also but once again has an example you can download and view...

http://www.superdroidrobots.com/rs232.htm

same site with a kit...

https://www.superdroidrobots.com/shop/item.asp?itemid=683

and this page has lots of samples... (you have to search for vb6 on the page to find them all)

http://www.compumotor.com/support_samples.htm

and there are so many more. This is the search I used to find them...

http://search.yahoo.com/search?fr=yfp-t-701-s&toggle=1&cop=mss&ei=UTF8&rd=r2&p=vb6%20rs232%20example

Good Luck

vb5prgrmr 143 Posting Virtuoso

Lines 22 and 23 need to be reversed. First open the recordset, then set the recordsource, and finally do the refresh, which reminds me. No need to do the refresh in the loop. After that then you might also want to follow AK's advice above...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Capture start time into a variable and use datediff function to test the difference returning seconds mod 60 returns minutes mod 60 returns hours. Understand?

Good Luck

vb5prgrmr 143 Posting Virtuoso

And??? I'm still not understanding but good luck anyways...

vb5prgrmr 143 Posting Virtuoso

What do you think I pointed you to with that search and suggested sites?

vb5prgrmr 143 Posting Virtuoso

Are you using the PDW? (Package and Deployment Wizard) If so, when you are walking through the steps, there is a screen that allows you to add files (Files are not added automatically when you put them in the support directory, you have to add them.). Use this screen to add the database and to specify where it is to be installed.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Where did you tell your setup package to install your database? Because I believe the path you used to point to your database is incorrect and hence the error you are recieveing...

Good Luck

vb5prgrmr 143 Posting Virtuoso
Private Sub Command1_Click()
Dim F As Form
Set F = New Form1
F.Show
End Sub

Good Luck

vb5prgrmr 143 Posting Virtuoso

In form1 create a public sub so when you hide form2 you can call it...

Form1.MyPublicSub
Me.Hide

then in the form1's mypublicsub you instruct whatever data access method you are using to refresh/requery itself and to redisplay the information.

Good Luck

pankaj.garg commented: thanks... +0
vb5prgrmr 143 Posting Virtuoso

In visual basic 6.0, if you have a form displayed it will recieve these events, and how you interpret and intercept them is through the query unload event of the form. As for the OS's status there is a whole lot more information than that, that you can acquire. Look into the application wizard and have it create an about form for you if you are interested (at least I think it is the about form???).

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well, if you have the findwindow API working you are half way there if not more. Search on vb6 kill process, vb6 terminate program, vb6 sendmessage wm_close (at least if my memory serves me right that is the constant to use...).

Good Luck

vb5prgrmr 143 Posting Virtuoso

Not quite sure what you are asking but I do know you will need to use ExtractIconEx. Now, in these search results ...

http://search.yahoo.com/search?fr=yfp-t-701-s&toggle=1&cop=mss&ei=UTF8&rd=r2&p=vb6%20extracticonex

I would suggest that you have a look at vbAccelerator, theScarams, and vbnet.mvps.org examples. One of them should lead you into the right direction...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Why not just use the DriveListBox???

vb5prgrmr 143 Posting Virtuoso

by use of the rnd function (see help) and the randomize statement in your startup object.

Good Luck

vb5prgrmr 143 Posting Virtuoso

two different ways are shown in the following...

Option Explicit

Private Sub Command1_Click()
OpenShowFile
End Sub

Private Sub OpenShowFile()

On Error GoTo OpenShowFileError

Dim FName As String, FNumb As Integer
Dim FileContents As String

CD.CancelError = True
CD.Filter = "Text Files *.txt|*.txt"
CD.FileName = vbNullString
CD.ShowOpen

If CD.FileName = vbNullString Then Exit Sub

FName = CD.FileName
FNumb = FreeFile

Open FName For Input As #FNumb
FileContents = Input(FileLen(FName), #FNumb)
Close #FNumb

Text1.Text = FileContents

Exit Sub
OpenShowFileError:

If Err.Number = 32755 Then Exit Sub 'user pressed cancel

End Sub

Good Luck

vb5prgrmr 143 Posting Virtuoso

Don't think so but look at Project>References. You should have these four at the top and in this order...

Visual Basic For Applications
Visual Basic runtime objects and procedures
Visual Basic objects and procedures
OLE Automation

Okay, so you are wanting to create an access database and not just open one (as what your code is saying...)

Okay, see post #12 in this thread for an example... http://www.codeguru.com/forum/showthread.php?t=476345

or since you are using DAO start a new project and add the 2.5/3.51 compatability library and then type in...

Dim DB As DAO.Database
Set DB = DBEngine.CreateDatabase

and with the cursor somewhere in or at the end of createdatabase press F1 to bring up help.

Good Luck

pankaj.garg commented: Thanks...this helped +0
vb5prgrmr 143 Posting Virtuoso

J2, read the forum rules...

AND, if the OP would download the WIA SDK they would have all the example code they would need. It is that simple!

By the way, Classic VB or Visual Basic 6.0 has the ability to display BMP, ICO, GIF, JPG, JPEG, EMF, WMF. Then with win95 to win2k the Wang/Kodak controls allowed us to display Tiff files among other formats, and after that, MS invented WIA so various formats could be displayed including Tiff. Then with the use of WIA or GDI+ PNG's can be displayed...

As for giving away code J2, I am not in business or in the habit of doing such a thing as I am paid to create code, so why would I just give it away???

vb5prgrmr 143 Posting Virtuoso

Well first off you need to make sure the directory exists by using the dir function and if it does not exist then you need to use the mkdir statement. HOWEVER, if you are on vista or win7 and in the program files directory, you will not be able to use app.path. Instead, use environ("appdata") & "\ProgramName\Data\nameofmdb.mdb.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well sorry you feel that way but I figured that since the second and third link in that search solves your problem in two different ways, I guess I just figured that you were smart enough and determined enough to find them. But hey, I guess that is what I get for thinking...