vb5prgrmr 143 Posting Virtuoso

What OS? Vista? 7? What is your path? Are you in/under Program Files? You may be having a problem with redirection. Also, use Option Explicit at the top of every code window, which also brings up the point of going to Tools>Options and putting a check next to Require Variable Declaration. Double check your paths, especially if you are using App.Path as it will return C:\ if you are at the root and if not it will return C:\SomePath. Thus making you need to check to see if Right(App.Path, 1) = "\" to build your paths correctly.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, and so you say that you are using M$ SQL Server right? Have you gone to http://www.connectionstrings.com yet and looked at their connections strings for SQL Server? Because if I remember correctly, they have a version or two for opening a database over the internet. Then they also have several versions for opening a database over a network.

Then, if you need to learn ADO, use your friends (yahoo, google, ask, answers, bing) and search for vb6 ado tutorial...

Good Luck

vb5prgrmr 143 Posting Virtuoso

As adatapost pointed out, you need to look up the following in help or online...

FreeFile Function
Open Statement
Line Input Function
Close Statement

Then, use your friends (yahoo, google, ask, answers, bing) and search for vb6 excel tutorial or vb6 automating excel...


Edit: Also while searching, vb6 common dialog tutorial


Good Luck

kvprajapati commented: Helpful! +9
vb5prgrmr 143 Posting Virtuoso

Once again, when you say ONLINE are you talking about over the INTERNET or your own PRIVATE NETWORK? As it can be interpreted that a database is online when the service is running. A computer can be online even though it is the only machine for 100 miles with no connection to a network or the internet! So which is it?!?!?

vb5prgrmr 143 Posting Virtuoso

Okay, when you go to close the form, you need to some cleaning up of your objects that you have created/initialized. The timer for one would be good to disable with a timer1.enabled = false and you should close your com port in the proper way. You can do this cleanup in either query unload or in unload.

Good Luck

vb5prgrmr 143 Posting Virtuoso

When you say database online are you talking over the internet, or your private network? Because there is a big difference between the two and the types of databases you can access over the web. For connection string information see http://www.connectionstrings.com...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, you have to put the forumulas I showed you, in the right places within that if statement...

Also Lines 6 and 8. I want you to look closely at and look at the logic of what you have going on with those if checks. Yes, I am hinting that something is wrong with your logic...

also Line2 should be Hours = Int(txtnumberofhours.text)

You need to slow down and think of the logic going on here because you have had all the information for a couple of days now and it just seems like you are wanting someone to do your work for you. You have the pieces, now just assemble them in the correct order, and you will have your solution.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Where is your if hours <= 40 then, elseif hours > 40 and hours < 50 checks?

vb5prgrmr 143 Posting Virtuoso

You can find your own information on the web with your friends (yahoo, google, ask, answers, bing). All you need are the right keywords.

One place to go is to the top pinned thread of this forum where I list a few searches from yahoo, a bunch of sites including http://www.planetsourcecode.com where you can find example projects.

Presently, from the title of this thread, I would suggest your searches using your favorite search engine should be along the line of vb6 pos system or vb6 retail system and/or switching up system with application.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Line 5 If user_rs.Fields("THECOUNT") = 0 Then

Good Luck

vb5prgrmr 143 Posting Virtuoso

Through access itself... NOT VB!

vb5prgrmr 143 Posting Virtuoso

Okay, within access the application, under tools>security>set database password. Enter the password you want. Then in your connection string, enter the same password...

Good Luck

vb5prgrmr 143 Posting Virtuoso
strSQL = "SELECT COUNT(idfield) AS THECOUNT FROM tablename WHERE field1 = '" & sometextvalue & "' AND field2 = '" & someothertextvalue & "'"
rs.open strSQL, ...
If rs.fields("THECOUNT") = 0 Then
  MsgBox '...

is what debasisdas meant...

and debasisdas,

>this will be faster as you do not have top loop through the recordset.

hence my reply previously...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Without seeing your code... It is kind of hard to tell where you went wrong or where you missed something...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Line 19 Do While Rs.EOF = False
Line 20 Starting here is where you should do "some processing"
Line 21 rs.movenext
Line 22 loop
Line 23 rs.close
Line 28 move to line 18 and put oppsite of it at line 24
Line 24 to 35 delete


Good Luck

vb5prgrmr 143 Posting Virtuoso

IDE = Integrated Design Environment
Yes you do know about the recordcount as I showed you this before...

debasisdas, presently jemz does not need to loop through the recordset looking for a match as the username/password are provided as part of the query in the where clause...

jemz, the pessimistic locking is how the database will react when you use the edit/addnew method of the recordset. Pessimistic locks the page when you execute the edit/addnew statement while optimistic locks the page when the update method is executed. So...

rs.fields("fieldname") = somevalue 'pessmistic locks here
rs.update 'optimistic locks here

So presently, since you are not editing the returned recordset, it does not matter.

Good Luck

vb5prgrmr 143 Posting Virtuoso

The answer is there already... I don't know what else I can do except do your work for you!

vb5prgrmr 143 Posting Virtuoso

You need to create an install package and install the program to your computer...

Good Luck

vb5prgrmr 143 Posting Virtuoso

>If they work between 41-50 hours (which is considered as overtime), they get 40 hours of pay PLUS an extra $1.50 per hour
e.g. 45 hours (40 hours x $5.50) + (5 additional hours x $5.50 x $1.50) = $261.25
OverHours = (Hours - 40)
Hours = 40
GrossPay = (Hours * 5.5 ) + (OverHours * 5.5 * 1.5)

and

WellOverHours = (Hours - 50)
OverHours = (Hours - (40 + WellOverHours))
Hours = 40
GrossPay = (Hours * 5.5 ) + (OverHours * 5.5 * 1.5) + (WellOverHours * 5.5 * 2.5)

Good Luck

vb5prgrmr 143 Posting Virtuoso

in the code window, type in Dim rs As ADODB.Recordset and press F1. When the dialog comes up, select the VB one and the help file will tell you all the options and their meanings. Its a quick enough read...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Unfortunatly??? The API makes life so much easier!!!

Time to use your friends (yahoo, google, ask, answers, bing) and search for vb6 cpu monitor or vb6 cpu usage. You will definitly find some sourcecode out there. Also, check over at PSC (planetsourcecode)...

Good Luck

vb5prgrmr 143 Posting Virtuoso

cn.Execute should be rs.open source, active connection, cursor type, lock type, options where...

source = "select *..."
active connection = cn
cursor type = [see help for this enum]
lock type = [see help]
options = optional parameter ususally left off

Good Luck

vb5prgrmr 143 Posting Virtuoso

See GetLastError and FormatMessage API...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Try the record macro feature...

Good Luck

vb5prgrmr 143 Posting Virtuoso

But would you want to ride in an elevator controlled by a visual basic 6.0 program? :)

vb5prgrmr 143 Posting Virtuoso

Actually, VB6.0 does not support a lot of icon formats that .NET does, like *.png or more than 256 colors or a size larger than 32x32. See the help files for more information or search the web for more accurate information.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Couple of notes here...

"I need help" is really not a good thread description as most all who create threads in these technical forums need help in one form or another.

When posting code, use the [ code ]code goes here[ /code ] tags.

Sometimes it is better, as in this case, to use a forums advanced features. e.g. The Go Advanced button below so that you can attach the form/zip file you are having problems with.

Now, to answer your question. It sounds like you want to set the focus to another button when a button is clicked but from what I can see, it looks more like you want to invoke the event of the other button before the code in the button that was clicked is executed. So here are the answers to both...

to set focus to another button...

Private Sub Command1_Click()
Command2.SetFocus
End Sub

To execute the code under another buttons click event before the code under the current button that was clicked...

Private Sub Command1_Click()
Command2_Click 'call the code under command2 so it executes
'command1's code goes here
End Sub

Good Luck

vb5prgrmr 143 Posting Virtuoso

To attach pictures to your post, or to attach a zip file, use the go advanced button below. Then you will be given the options to attach pictures and files...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Because you are inserting a record, not returning a record. When records are returned, use a recordset. When just updating, inserting, or deleting, use either the connection object, or the command object.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Good Luck!

vb5prgrmr 143 Posting Virtuoso

Yes! Friends! Search! vb6...


Good Luck

vb5prgrmr 143 Posting Virtuoso

Going to need a whole lot more information than that to be able to figure out something! What code do you have so far?

Good Luck

vb5prgrmr 143 Posting Virtuoso

Are you talking about a scrolling background, or changing the left property of a image or picture box control?

and BTW, help as a subject title is not very descriptive...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Yes I do as a matter of fact and so will you if you purchase/download someones SDK that has visual basic 6.0 examples...

Good Luck

vb5prgrmr 143 Posting Virtuoso

With a search of one of my friends, the first one, (yahoo, google, ask, answers, bing) on vb6 license plate recognition you will find a couple of results on the first two pages of results. Then with a search with vb6 license plate ocr you will find more results on the first two pages.

Just a note for you, you may read a lot of stuff that you may think is not what you need but as you read, find the tools that they used. Like lead tools or omnipage. You also might want to search on ocr, ocr sdk, ocr software and so on.

Good Luck

vb5prgrmr 143 Posting Virtuoso

"provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "\project.mdb & ";User Id=admin;Password=;"

See http://www.connectionstrings.com for more information...

Good Luck

vb5prgrmr 143 Posting Virtuoso

your close but a few things wrong with your string concatination...

"SELECT * FROM LERNER WHERE LICENSE_NO='" & Text1.Text & "'", db,...

Good Luck

vb5prgrmr 143 Posting Virtuoso

You know what, it should actually be easier for you to use the connection object to execute you sql insert statement, but here is an example of both from an old test prog...

Option Explicit

Dim S As String

Private Sub Form_Load()

Dim adoCn00 As ADODB.Connection
Dim adoCm00 As ADODB.Command
Dim adoRs00 As ADODB.Recordset

Set adoCn00 = New ADODB.Connection
adoCn00.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\z\temp.mdb;User Id=admin;Password=;"

S = "INSERT INTO tblTest(vText) VALUES('Test Line 1')"
adoCn00.Execute S

Set adoCm00 = New ADODB.Command
adoCm00.ActiveConnection = adoCn00

S = "INSERT INTO tblTest(vText) VALUES('Test Line 2')"
adoCm00.CommandText = S
adoCm00.Execute S

End Sub

Good Luck

vb5prgrmr 143 Posting Virtuoso

Everything looks good except for line 4, you should use a command object there and not a recordset object, beyond that, the only thing I can say anything about is you indenting of the code in that section needs to be cleaned up a little...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Did you miss the End Select?


Good Luck

vb5prgrmr 143 Posting Virtuoso

Well once you try and connet, if the connection fails, you should get an error, if you do not get an error, then presumably, you have a good connection. Also, you should be able to test the connectionstate or whatever the property is to see if it is adstateopen/closed or whatever. Press F1 to see the help files on the subjects and the correct parameters to test against (see example if they have one)...

Good Luck

vb5prgrmr 143 Posting Virtuoso

>Is the BJ Preview software owned by MICROSOFT...

Never heard of BJ Preview and with a quick search of my first friend (yahoo, google, ask, answers, bing), did not return anything worth looking at on the first page, but I can say that this thread was the top two listings.... (Horray for daniweb :))

So best bet is to ask your boss where the software came from and do they have a web site. Then if they have a web site, do they have a forum or support system or frequently asked questions area...

And if you do find out who or what made the control, it would be nice if you posted it here...


Good Luck

vb5prgrmr 143 Posting Virtuoso

The reason it is giving you that error is because I did not complete the if elseif end if structure as it was only to be an example for you to do your own codeing.... not only to complete the structure for the remaiing weights but also the else and end if...


Good Luck

vb5prgrmr 143 Posting Virtuoso

Check out the Round function and the Format function and for how vb rounds, see some of the articles this search brought up...

http://search.yahoo.com/search;_ylt=AsacIZvoNaeCzNBceyH577ObvZx4?p=how+does+vb6+round+numbers&toggle=1&cop=mss&ei=UTF-8&fr=yfp-t-701

Good Luck

vb5prgrmr 143 Posting Virtuoso

You will probably want to go with an if elseif structure...

If Weight <= 1 then
ElseIf Weight > 1 And Weight <=2 Then
'...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, you are saying you want to edit a field? You want to set some field in some table = to some value?

strSQL = "UPDATE tablename SET fieldname = " & somevalue

if string then ... '" & somevalue & "'"
if number, as show in code block
if date, as I have previously shown you...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, I'm guessing that weight calculations are based upon earth standard normal, which means that based upon a packages weight being sent to the moon you would multiply it by .6 to get its destination weight, which is what I believe to be your excercise. From there you can use the select statement or a series of if elseif's to test that destination weight to calcualte the price. Once that is done, then you will be able to display the results...

Good Luck

vb5prgrmr 143 Posting Virtuoso

To begin with, did you just copy the exe or did you make an install package with the PDW, Inno, Windows Installer 1.1, or other installation package? Second, are you using App.Path as part of your connection string? Third, what OS? Fourth, see this for some valuable information... http://www.vbforums.com/showthread.php?t=456795 and don't forget to follow the links...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Using the ADODC1 or the MSRDC1 is not the best idea as you should use ADO, RDO, or DAO ODBC Direct with an ODBC DSN. However, with a visit to http://www.connectionstrings.com, you can use a DNS Less connection string with ADO (preferred technology by most people). Now, if you are shaky on using ADO, you can easily find a tutorial on ADO by using your friends (yahoo, google, ask, answers, bing) and searching for vb6 ado tutorial...

Good Luck

vb5prgrmr 143 Posting Virtuoso

sharif, boya, both of you need to read this thread as your answer is contained within, and on future inquiries, let it be known to both of you that raising the dead is looked down upon around most forums. If you need to reference an older thread, then copy its url into a thread of your own making....

Good Luck