vb5prgrmr 143 Posting Virtuoso

If the form is shown, you might be able to use LockWindowUpdate API in the following manner

LockWindowUpdate Grid.hWnd
'do loading here
LockWindowUpdate 0

Another method would be to hide the grid that you are loading and show a dummy grid along with a progress bar...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Use your friends (yahoo, google, ask, answers, bing) and search for ShellExecute API or ShellExecuteEx API with the key word vb6 to get some code that will work for you in VBA...

Good Luck

vb5prgrmr 143 Posting Virtuoso

For background music, midi, rmi, and such, have a look at the MMC (Microsoft Multimedia Control) then you can still play sound effects in wav format using sndPlaySound API over the background music and yes, I do mean at the same time...

Good Luck

vb5prgrmr 143 Posting Virtuoso

It looks like in both timer events (1 and 2) you are moving only Picture1... Should not timer2 be moving Picture2?

Good Luck

vb5prgrmr 143 Posting Virtuoso

Don't forget the files extension... App.Path & "\student.mdb"


Also: To set the path, use ChDir (see help)


Good Luck

vb5prgrmr 143 Posting Virtuoso

Using an autoincrement field in access this will happen as it should happen. Now why this happens is because not everyone knows how to setup a parent child relationship within access. Think about this. You have a parent child relationship but don't have it setup through access, so when you delete the parent records and leave the child records then reuse that pointer, now those old child records are pointing to your new parent record and may not have a thing to do with it.

Now with all that said, you can get around this behavior by design by compacting and repairing the datbase. However, if you add a new record before you compact, (1,2,3,...,9,11) you will not be able to recover the unique ID 10... When that is not unless you take off the unique constraint and the index on the field. Then inserting the id of 10, reindexing and then adding the constraint...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Are you actually using VB5 or VB.NET 2005 because if the later you are in the wrong forum...

vb5prgrmr 143 Posting Virtuoso

Andre! Really! .BLOAT code in the vb6.0 forum? Shame on you! :)

Jaws,

Using the shell function, shellexecute(ex) API with the open verbs will only open the destined file with the default program. If you want to open a file with another program than the one registered as the default, you will need to hope it accepts command line parameters and you could pass the path of the file to the exe that is to open it... (c:\Program Files\MyProgram.ext o/c:\ProgramData\MyProgramName\filename). Another way would be to automate the other program and make it open the file...

Good Luck

vb5prgrmr 143 Posting Virtuoso

As you have found out, since the PB is a container control, you can have the PB anchored to any side of the MDIParent form but it cannot be free floating. However, you can make it look like it is free floating by using a MDI child with no caption and no toolbox with a borderstyle of none. Then you could size your PB to the size of the form...

Good Luck

PoisonedHeart commented: Tnank you for your help! +2
vb5prgrmr 143 Posting Virtuoso

Look up Lead Technologies, Pegasus Software, or just use your friends (yahoo, google, ask, answers, bing) to search for ocr sdk...

Good Luck

vb5prgrmr 143 Posting Virtuoso

I've got no problems with SendMessage on my Vista Home machine. In fact, it is working right now to slap down script error messages from the web browser control in another application...

vb5prgrmr 143 Posting Virtuoso

Check out the Dir Function, the MkDir Statement, and the FileCopy Statement...


Good Luck

vb5prgrmr 143 Posting Virtuoso

What do you mean SendMessage API will not work on vista? Or are you talking about sendkeys?

vb5prgrmr 143 Posting Virtuoso

Time to use your friends (yahoo, google, ask, answers, bing) and search for vb6 directx tutorial. Also, over at PSC (planet-source-code.com) you could do a search for vb6 3d and find many examples on directx and a few that do it without the use of directx...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Andre, looks good but have a look at CDate to convert strings to a numerica value, then do the subtraction followed by the format function as in this abbreviated example...

Option Explicit

Dim Start As Date

Private Sub Command1_Click()
Dim MyStop As Date, Difference As Date
MyStop = Now
Difference = MyStop - Start
MsgBox Format(Difference, "hh:mm:ss")
End Sub

Private Sub Form_Load()

Start = Now

End Sub

Also Andre, I think there may be times where your code would be preffered over other code, but remember, there is always more than one way to skin a cat... :)

Good Job :)

vb5prgrmr 143 Posting Virtuoso

Okay,...

*1*1* should do the trick but this is off the top of my head so you might also need a or *11* or % wildcard characters in stead of *

then... *1*2*3* or *2*1*3* or *3*1*2* or *2*3*1* or *1*3*2* or *3*1*2* or *3*2*1* or *12*3* or .... and so on

Best bet is to use Access's query designer to play around with the query and then goto sql view to copy it out from there to put into your program, at least for your more complex queries but for this I think you will also need to figure out all of your permutations so you can add them to your query. Which you can use either nested loops or a recursive function call...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Yes, it can all be done with one button but you will need to do some reading first...

Okay, first off, let me introduce you to your new best friends, and they are yahoo, google, ask, answers, and bing. What? You say! How can search engines be my new best friends? You ask! Well let me tell you how. These search engines have access to hundreds if not thousands, or more, of articles, code snippets, descriptions of code and so on. So now you will need to learn how to use these powerful tools to help you, and how they can help you is by you using these letters in your search when you search for information on vb6.

So your first search should be for vb6 ado tutorial.

Now, you can also restrict your searches to only vb6 information by using -.net but there are those sites out there that have both .net and vb6 info.

Okay, now that you have that under your belt. Lets also start you off with learning how to use the MSDN help files that come with VB/VS. So now I want you to start VB and start a new standard exe project. Once VB is loaded, press F1 to activate the help files.

When the help files show, click on the index tab and type in the following so that you can read all about these...

FreeFile Function
Open Statement
Input Function
Line Input …

vb5prgrmr 143 Posting Virtuoso

No I cannot help you by giving you code but I can help you define your problem so you know what code to write!!!

Okay, you have two players and two sets of controls. So what you will need is two variables. One each for each player. Then you will need to set each variables value in the click event of one or the other set of controls. Meaning Variable one's value will be set with group one's controls and variable two's value will be set with the other group's controls.

something like this pseudo code...

in player1's rock button click event...
v1=1
or in player2's rock button click event...
v2 = 1
and so on for both in paper (v1/v2=2) and scissors (v1/v2=3)

Then of course you will need to evaluate who won the battle but instead of creating the same code in each players buttons click event, you would want to create a seperate procedure to do the evaluation and call it from each click event, which also means that player1 and player2 variables need to be declare in the general declaration section of the form so that they are visible throughout the form.

Okay, so the procedure you need to create could go something like this pseudo code...

if v1=v2 then
'tie
msgbox "Tie, try again!"
v1=0 'reset variables
v2=0
elseif v1=1 and v2=2 '1=rock, 2=paper
notify here
reset here

vb5prgrmr 143 Posting Virtuoso

You need to set the textbox multiline property to true. Then you can use...

Text2.Text = vbNewLine & Text1.Text

Good Luck

vb5prgrmr 143 Posting Virtuoso

Hmmm... The choice of game you have decided upon gives me great concern but after reading what you wrote I understand that this is more of an excercise for you than an actual project. So with that said, all you need to do is to build a decision tree that test the values of each players input to decide the winner...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Remove the WithEvents keyword as it is telling you that it does not support callback events...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, for using the Query Builder in M$ Access, once you have your sample query built, you can goto view SQL view. Copy it from there and paste it into your program. You will of course have to clean it up a little and make it so that it can accept your inputs in the where clause.

Then for your display problem, once you have updated the account, you should be able to do a requery or refresh on your rs and if you have it bound to a control, that control may need to do a rebind, refresh or whatever method the control supports.

Good Luck

vb5prgrmr 143 Posting Virtuoso

You really need to loop up the Get Function in help... and then look up the Input Function or the InputB Function...

Good Luck

vb5prgrmr 143 Posting Virtuoso

First off, use M$ Access Query Designer Tool to create your more complex queries.
2nd, if you cannot look up CDbl in help, then do you actually have a legal copy VB?
3rd, and your right! What is the purpos of that code...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Because the cursor type you have chosen only knows about the first record, the record it sits on. To fix, do a movelast, movefirst and this will tell your cursor type how many records are in the recordset...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Friends time (yahoo, google, ask, answers, bing) URLDownloadToFile API...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Compile program and make an installable package with the PDW, VSI 1.1, Inno, or any other number of installers whether scripted or not...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Browse button = Microsoft Common Dialog Control (Press CTRL+T and select it)

Open the file... Here is where you terminology is wrong as you do not need to open a file to rename it but the following is for opening any file...

In help on index tab look up the following...

FreeFile Function
Open Statement
Line Input Statement
Input Function
Close Statement

As for opening and playing *.wav files, see sndPlaySound API or the PlaySound API...

Rename a file = the Name Statement (once again on index tab of the help files)

The "export" will happen when your code executes the name statement...

As for code, let us see what you have tried so far...

Good Luck

vb5prgrmr 143 Posting Virtuoso

You need to calculate its aspect ratio...

Option Explicit

Private Sub Form_Load()
Dim P As StdPicture, AspectRatio As Double
Set P = LoadPicture("your image path file name here")
If P.Width > P.Height Then
  AspectRatio = P.Height / P.Width
  IMG.Width = Me.ScaleWidth - 60
  IMG.Move 30, 30, Me.ScaleWidth - 60, (IMG.Width * AspectRatio)
ElseIf P.Width < P.Height Then
  AspectRatio = P.Width / P.Height
  IMG.Height = Me.ScaleHeight - 60
  IMG.Move 30, 30, (IMG.Height * AspectRatio), Me.ScaleHeight - 60
Else
  AspectRatio = 1
  IMG.Height = Me.ScaleHeight - 60
  IMG.Move 30, 30, (IMG.Height * AspectRatio), Me.ScaleHeight - 60
End If
IMG.Picture = P
End Sub

Good Luck

vb5prgrmr 143 Posting Virtuoso
Dim MyArray() As String, MyString As String
MyArray = Split("JK-501-3556-25-A-03#C", "-")
MyString = MyArray(0) & "-" & MyArray(1) & "-" & MyArray(2) & MyArray(3) & "-" & MyArray(4) & "-" & MyArray(5)
MsgBox MyString

Good Luck

vb5prgrmr 143 Posting Virtuoso

See http://www.connectionstrings.com and your friends (yahoo, google, ask, answes, bing) to search for vb6 ado tutorial...


Good Luck

vb5prgrmr 143 Posting Virtuoso

Instead of using the select case there OP and Andre, how about the Chr function...

?Chr(101)
e

Good Luck

vb5prgrmr 143 Posting Virtuoso

Andre!...

that would be...

For x = 0 to List1.ListCount - 1

Good Luck

vb5prgrmr 143 Posting Virtuoso

Have a look at http://www.connectionstrings.com and use your friends (yahoo, google, ask, answers, bing) to search for vb6 ado tutorial...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Friends time... (yahoo, google, ask, answers, bing) and search for vb6 facial recognition... I know intel did a series of commercials about it so you might want to check their site...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Select DISTINCT...


Have a look it up in help...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Friends time (yahoo, google, ask, answers, bing) vb6 insert picture into database or vb6 retrive picture from database...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Kinwang, Andre,...

>Text1.text is contains the name of the file to be put into the database.

Mr. Nervous is trying the insert the contents of a text file into the database, but as you can see from his select statement, and if you think about the logic here, you will see where Mr. Nervous is having his problems....

Mr. Nervous,

First of all you need to open the file and read its contents in. Please look up the following on the index tab of the help files and don't forget to look at the examples.

FreeFile Function
Open Statement
Input Function
Line Input Function
Close Statement

Then, use your new best friends (yahoo, google, ask, answers, bing) to search for vb6 ado tutorial.

So your process would be something like this pseudo code...

read file in
open connection to database if not already open
prepare sql insert statement
execute sql insert statement with the connection objects execute method

Good Luck

vb5prgrmr 143 Posting Virtuoso

What version of access? because if *.mdb is either 2k or 97 or earlier, you may need MDAC 2.5 as the jet components were seperated out of the MDAC thereafter... Just a thought...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Yes it is possible, but not quite as easy.

If you know how many dimensions there are to begin with, you can do it like so...

Dim MyArray(1 To 25, 1 To 2) As String 'or could be 0 to 24, 0 to 1

MyArray(1, 0) = "UserName1"
MyArray(1, 1) = "RealName1"
'...
MyArray(25, 0) = "UserName25"
MyArray(25, 1) = "RealName25"

Or you could create your own UDT (User Defined Type)...

Option Explicit

Private Type MyUserType
  UserName As String
  RealName As String
End Type

Dim MyUser(1 To 25) As MyUserType

Private Sub Form_Load()
MyUser(1).UserName = "UserName1"
MyUser(1).RealName = "RealName1"
'...
MyUser(25).UserName = "UserName25"
MyUser(25).RealName = "RealName25"

End Sub

Good Luck

vb5prgrmr 143 Posting Virtuoso

Use either the Join Function and InStr to find ",5," or use a for loop to go from LBound to UBound and test for the value...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Search a persons name, retrieve their address (so far from personal data store), then maps.google api to pull over head from satellite image... is the way I take it and guess what IT IS AGAINST GOOGLE EULA! Google does not want thier API or system used by FAT Clients like most anything that VS (yes VS as in Visual Studio) uses... So tell you teacher to read Google Map API EULA just to be sure...

vb5prgrmr 143 Posting Virtuoso

Well for future reference there real, you are in the wrong forum. You need to be in the vb.net forum...

vb5prgrmr 143 Posting Virtuoso

and lets not forget the updated installer, visual studio installer 1.1 that is the replacement for the PDW and you can find a link to where it is at an archive site by looking in the top pinned thread of this forum where I posted the link to the archive site. you will find the link in the thread with the title of vb6 stuff,...,tips and tricks or something like that. It is post 5 or 6...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Kin and Abu are talking about using the intrinsic timer control and not the SetTimeEvent API. Also, their values of 1000 to set its interval property, well it only equals 1 second. If you want one minute like you originally said, you will need to set its interval to 60000...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, those doublets, doubles, pairs of characters are already in hex notation. To retrieve their values, put &h in front of them...

Dim Value As String
Value = "FF"
debug.print CByte("&h" & Value)
debug.Print CInt("&h" & Value & Value) 'actually returns -1 so use clng
debug.Print CLng("&h" & Value & Value & Value)
debug.Print CLng("&h" & Value & Value & Value & Value) 'returns -1 so use cdbl

Good Luck

vb5prgrmr 143 Posting Virtuoso

Let me introduce myself, I'm a... whopps wrong song here at the moment but let me intoduce you to your new best friends. They are yahoo, google, ask, answers, and bing. Now these guys will work tirelessly for you but they can be pretty dumb. So if you only want results for visual basice 6.0 you can either use vb6 or -.net as part of your search criteria but I will suggest to only use vb6 because there are a lot of sites out there that started with vb6 and then went to .net. So if you did a -.net you would miss some really good results. So now that I have introduced you to your new best friends, its time you pick one or more of them and go out and search for vb6 tutorial and since you want video tutorials, I would suggest vb6 video tutorial. You should find a couple on youtube...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Shipra, did you follow the link in the post before yours and did you follow the links in that thread? Should be well over 100 different ideast between those two...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Not English, Engrish!

vb5prgrmr 143 Posting Virtuoso

I tested the first link to code and I am on vista home with UAC turned on and I'm fairly sure that the code in the second link I gave will work also as I have never had a problem with code from that site...