vb5prgrmr 143 Posting Virtuoso

Okay, if you want to see if a file or directory exists, you can use the Dir Function (see vb's help files for full description). So, what you would do, is something like...

Dim ForLoopCounter As Integer

For ForLoopCounter = 0 To Combo1.ListCount - 1
  If Dir(App.Path &  "\Ordinance\" & Combo.List(ForLoopCounter) & "\" & txtFind.Text & ".txt") <> vbNullString Then
    'Found
  Else
    'Not Found
  End If
Next ForLoopCounter

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay,... Your query should be more like this...

strSQL = "SELECT * FROM tablename WHERE fieldname = " & inputednumbervalue

or if string

strSQL = "SELECT * FROM tablename WHERE fieldname = '" & inputedstringvalue & "'"

and then to check to see if any records were returned you could check it like this...

If Rs.RecordCount <> 0 AND Rs.BOF = False AND Rs.EOF = False Then
  'have records
Else
  'no records
End If

NOTE: I check for all three conditions as you can see...


and this...

lab: If (rt.Fields(12) <> s) Then
rt.MovePrevious
GoTo lab

is not good programming practice. Not only because of using a GoTo to loop, but because you have no check for BOF, which means if user inputted a value that did not exist in the table, the recordset would error out as you tried to move prior to the first record and read a value. Now if you just went Huh? Well think of it this way, if you were to open a text file and try to read before the first line in that text file, what would you be reading? Nothing in that text file that is for sure.

Second, this...

rt.Fields(12)

While very easy to code, this does not lend itself to easy readability or more important, program maintence. While most programmers would know that you are referencing the 13th field of the table, the question is, what is that fields name? …

vb5prgrmr 143 Posting Virtuoso

If the textbox has focus then you are done. The key presses should be translated directly to the textbox. If however, the buttons (0-9) are what you are talking about then it should be something like...

Text1.Text = Text1.Text & Command1.Caption

Good Luck

vb5prgrmr 143 Posting Virtuoso

Look at the split function and dynamic arrays. Also, see the val function and the join function...

Dim MyDynamicArray() As String
MyDynamicArray = Split(Text1.Text, " ")
MyDynamicArray(1) = CStr(Val(MyDynamicArray(1)) + 1)
Text2.Text = Join(MyDynamicArray, " ")

You also may want to look at IsNumeric to make your code more flexible.

Good Luck

vb5prgrmr 143 Posting Virtuoso

And how can we help you without seeing the code???

vb5prgrmr 143 Posting Virtuoso
vb5prgrmr 143 Posting Virtuoso

You can read about cursors in VB's help files. As for connection string help see http://www.connectionstrings.com

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well I hope you catch your quary but as far as queries go, see this example...

strSQL = "SELECT * FROM table WHERE field1 = '" & somestringvalue & "' AND field2 = " & somenumericvalue

Good Luck

vb5prgrmr 143 Posting Virtuoso

Debug.Print ie1.url

Good Luck

vb5prgrmr 143 Posting Virtuoso

Couple of ways but the easiest would be...

FileToOpen = Format(Now, "yyyymmdd") & ".txt"

Good Luck

vb5prgrmr 143 Posting Virtuoso

Some simple calculations...
20 * 60 = 1200 * 60 = 72000 * 24 = 1728000 * 365 = 630720000 / 1024 = 615937.5Kb / 1000 = 615.9375Mb / 1000 = .6159375Gb
25 * 60 = 1500 * 60 = 90000 * 24 = 2160000 * 365 = 788400000 / 1034 = 769921.875Kb / 1000 = 769.921875Mb / 1000 = .769921875Gb

Which means that if you will be capturing a minimum of .615 to .769 Giga bytes of information. That is if each of your 20 to 25 fields are bytes and only bytes. This does not account for any unique fields like identity/autonumber fields which are a minum of four bytes for each record. Then there is your datetime stamp which is going to be eight bytes per record.

So what does all this mean? Well, you are going to have to figure out what each field is going to be and how much data that type takes up. Then once you have your record size, you can simply do the above calculations to figure out the minimum amount of disk space you need. Once you have that, you will then have a better idea of what kind of database you can use.

But that/this is not your only consideration when it comes to performance. Since you are going to be adding records every second, your machine will need a decent amount of ram because of the lag time between OS/server and hard drive …

pankaj.garg commented: thanks again for help :) +1
vb5prgrmr 143 Posting Virtuoso

Green = True
Yellow = True
Red = False

Who knows? How can we tell from the code you have provided? Oops, what code!

In all seriousness, how are we to tell from what you have provided. Is this actually an RS232 interface you are trying to communicate with? Or is it just a graphic you want to display for a school project?


Good Luck

vb5prgrmr 143 Posting Virtuoso

Yes, you have code something like this...

Dim F As New Form1
F.Show

somewhere in your code. Find it, change it to Form1.Show. Should fix it.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well if you have the appropriate version of vb, then you should also have data reports, a designer you can add in from under the project menu...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Simple way would be to set a timer controls interval property to 60000 milliseconds (1 minute), use a variable to either increment from zero to forty or decrement from forty to zero and when condition is reached, msgbox time.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Just remember, that just because you savepicture picture1, "mypathfilename.jpg" does not mean that you actually save the picture as a jpg. Save picture saves it as a bmp. You will need to search the web for code to save the picture as a jpg. Right off the top of my head I know that there is a dll out there that will do it for you, some sort of commandline exe, and then there is some GDI+ code, and finally, the WIA 2.0 from MS. Now, if on a 2k machine or earlier you could also use the Wang/Kodak image edit control to save it as a tiff with jpg compression and then just name the file as a jpg (control would not allow a jpg extension but would use jpg compression algorithm because at time the jpg was still under copyright (no longer)). Oh yeah! Search PSC for "save bmp as jpg". You should find a bunch of code...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Is the image temporialy saved to a picture box? If so Picture1.Print "My String". Also, take a look at the currentx/y properties so you can adjust where your text gets printed.

Good Luck

vb5prgrmr 143 Posting Virtuoso

In vb's help look up the datediff function...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Don't know which program you are talking about because there are just so many but search the code for .map. Find where it is loaded/saved and I'm betting that it is a text file or binary file that tells the program which images to put where.

Good Luck

vb5prgrmr 143 Posting Virtuoso

.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Xyz.mdb"

Good Luck

vb5prgrmr 143 Posting Virtuoso

Put that in sub main, and add Form1.show before your exit do...


Good Luck

vb5prgrmr 143 Posting Virtuoso

Look on the CD as there are several examples but I believe you will have to use ADO for the CR...

Good Luck

vb5prgrmr 143 Posting Virtuoso
vb5prgrmr 143 Posting Virtuoso

Well, we are not here to do your homework and so this means you will have to read your book and the help files to find out this information.

First hint, start a new standard exe project, press F1, and on the index tab, type in "data types". Hit enter, and when the dialog comes up, scroll down to "Data Types Keyword Summary Visual Basic Reference". What you want to look at are the Set intrinsic data types. Click on one, read it, ALT+LeftArrowKey (to move back to the page you were on.).

Then, when you are done reading about variant data type, while you are on that page, click on see also and select "Data Type Summary".

Good Luck

vb5prgrmr 143 Posting Virtuoso

So then you have right clicked on the setup.exe and chosen runas admin and still having this problem....

Two possible solutions for you, Inno or Windows Installer 1.1

Good Luck

vb5prgrmr 143 Posting Virtuoso

Time to see your friends (yahoo, google, ask, answers, bing)...

http://search.yahoo.com/search?p=vb6+rs485&toggle=1&cop=mss&ei=UTF-8&fr=yfp-t-701

Good Luck

vb5prgrmr 143 Posting Virtuoso

Hmmmm... Ahhh... Hmmm... So it works when using the ODBC DSN in the CR designer but not via the CR control from VB... Hmmm...

Okay, with a search on yahoo for vb6 crystal reports 8.5 tutorial, I get a bunch of junk but on the 3rd page of the search results I found this...

http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=65542&lngWId=1

While not a tutorial, the code for the reports should help you in telling you what is wrong with your code...

I'm really surprised that there is not at least an example out there some where...

BTW: there should be some example code for vb on the cr cd...


Good Luck

vb5prgrmr 143 Posting Virtuoso

If you are using ADO (not Data1 or ADODC1) then see http://www.connectionstrings.com for you ODBC DSN Less connection string that you would use to connect to anything from text files to oracle, progress, SQL, and so on.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Wrong forum!!!

vb5prgrmr 143 Posting Virtuoso

AND please post in the correct forum as this is for the "classic" visual basic 4/5/6

vb5prgrmr 143 Posting Virtuoso

Switch over to the FREE Windows Installer 1.1 or use the FREE Inno setup installers.

Good Luck

vb5prgrmr 143 Posting Virtuoso

>use some third party control to display popup message.

A form or msgbox would do...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Actually, you don't need to declare a variable. You can use the tag property for something like this...

Option Explicit

Private Sub Command1_Click()
Text1.Tag = Text2.Text
Text2.Text = Text1.Text
Text1.Text = Text1.Tag
End Sub

Read up on it...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Look at the strConv function....

Good Luck

vb5prgrmr 143 Posting Virtuoso

If you used an ODBC DSN with CR, is that same DSN on the machine?

Good Luck

vb5prgrmr 143 Posting Virtuoso

Okay, sounds like you want to do a map editor where you can drag various objects like the terrain, buildings, and other features onto the map and then save the resulting image.

Have a look at this search on PSC where you will find more code than than you need...

http://www.planet-source-code.com/vb/scripts/BrowseCategoryOrSearchResults.asp?optSort=Alphabetical&txtCriteria=map+editor&blnWorldDropDownUsed=TRUE&txtMaxNumberOfEntriesPerPage=10&blnResetAllVariables=TRUE&lngWId=1

Good Luck

vb5prgrmr 143 Posting Virtuoso

.Circle?

vb5prgrmr 143 Posting Virtuoso

No have not heard of this but a possible remedy might be to download and install the redistributable service pack. This is version SP5...

http://www.microsoft.com/downloads/details.aspx?familyid=BF9A24F9-B5C5-48F4-8EDD-CDF2D29A79D5&displaylang=en

not sure if there is a SP6 as I have not seen one but hey it is an idea...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Yes, it sounds like an adforwardonly flag was set since you did not set them when you opened the rs.

Good Luck

vb5prgrmr 143 Posting Virtuoso

While, I would suggest using a menu with a key combination shortcut, the suggestion by SCBWV does work...

Start a new standard exe project and add in this order, text box (text1), label (label1), text box (text2). Now set the caption of the label to &Focus. You should see Focus in the labels caption. Now, just to make sure that the tab orders are correct, lets check.

Text1 TabIndex = 0
Label1 TabIndex = 1
Text2 TabIndex = 2

Run the program and press ALT+F. You should see the carat jump from text1 to text2.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well there was a thread around here somewhere (at least I thought) that had a bunch of different ideas but since I cannot find it here, I found another here http://www.dreamincode.net/forums/showtopic78802.htm

Good Luck

vb5prgrmr 143 Posting Virtuoso

A couple of different ways...

Hooking like this example... http://vbnet.mvps.org/index.html?code/subclass/aspectratio.htm which you would have to modify to fit your needs

or like this example http://vbaccelerator.com/home/VB/Code/Libraries/Subclassing/SSubTimer/VB6_Minimum_Form_Size_Demonstration.asp

and I though there was an example around the web using the SetWindowRgn API but I can't seem to find it now...

And finally you could use the forms resize event to force/keep the minimum size...

If Me.Width < SomeValue Then Me.Width = SomeValue

However, you will notice that this last method gives you some undesirable redrawing artifacts.

Good Luck

vb5prgrmr 143 Posting Virtuoso

Well... if you really want it to have a dos like output/input then...

http://visualbasic.about.com/od/learnvb6/l/bldykvb6dosa.htm


Or use your friends (yahoo, google, ask, answers, bing) to search for vb6 dos (shell, clone, application, program, command)...

Good Luck

vb5prgrmr 143 Posting Virtuoso

By using ADO, a select column from table statement, a do while not rs.eof, and of course combo1.additem rs.fields("fieldname")

Good Luck

vb5prgrmr 143 Posting Virtuoso

Use a for loop to run through from one to count or 0 to count-1 (I forget) and use text1.text= text1.text & ... & vbnewline

Good Luck

vb5prgrmr 143 Posting Virtuoso

Close the rs and if you open the rs as read only your following code would generate an error.

PS. Next time you are not creating a snippet but asking a question...

Good Luck

vb5prgrmr 143 Posting Virtuoso

By hook and crook! Also, you inner loop will be processed 100 times as will your outer loop for a total of 10,000 iterations or printings. Are you sure you want 10,000 printings?

Good Luck

vb5prgrmr 143 Posting Virtuoso

Recieved your PM and I have some advice for you. First, start a new project and add a reference to DAO ONLY. Then copy that code and give it a try, otherwise my next question will be how much are you willing to pay...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Putting a picture into memory or into a picture box is quite easy with the LoadPicture function. Reading each pixel is also easy, if not slow, by using the point method, which returns a long value that you can then break up into the RGB triplet by using some simple math. On the other hand you could speed the reading of each pixel up by using the GetPixel API.

Once you get started on some code, if you have any problems come back and post the relevant code. We will be more than happy to help...

Good Luck

vb5prgrmr 143 Posting Virtuoso

Thanks for uploading your code but there seems to be a problem. Windows reports that it is unable to open the zip file because it is an invalid zip file. I looked at the header and it seems like it is okay (pkzip?) but I'm going from memory and could be wrong. Please post your relevant code between the code tags.

Good Luck