jhai_salvador 48 Junior Poster

That explains it more.:)
Whilst in the browser, right click on the browser and select "Source Code" from the pop up menu.
Search for the control names, say cmdNext etc. Once you have this, you can manipulate the controls by say setting them to not visible etc.

You can use Google Chrome, right click on the control, then click the Inspect element. It will be easy for you to view the source from there.

jhai_salvador 48 Junior Poster

oh.. I didn't know that..

jhai_salvador 48 Junior Poster

Thanks, I just forget to set it to the correct discusion section because I am at the Code Snippet tab when I created this thread, so I hope mods will also fix the default combo box value when creating threads. Thanks.

jhai_salvador 48 Junior Poster

Thank you.

jhai_salvador 48 Junior Poster

Okay, this is just a simple trick to determine whether CAPS is pressed because some people here use API to determine whether the CAPS Lock is pressed.

KeyDown and KeyUp don't detect exactly the same information as KeyPress.

KeyPress detects a character in its KeyAscii parameter, but KeyDown and KeyUp detect a physical keystroke in their KeyCode parameter.

  • KeyUp and KeyDown can detect keystrokes not recognized by KeyPress, such as function, editing, and navigation keys.
  • KeyPress can distinguish between different ASCII characters generated by the same physical keystroke.

Where did I get KeyCode = 20? Try to use a breakpoint on Text1_KeyDown event to get the keycode of the Caps Lock. This will just be available on KeyDown event.

Hopes this helps.

jhai_salvador 48 Junior Poster

Try this...

lblids.Caption = lblids.Caption & rs.RecordCount
jhai_salvador 48 Junior Poster

remove this line so you can check if its bug free...

On Error Resume Next

Also add this line on your loop to prevent your application from hanging / lagging..

DoEvents
jhai_salvador 48 Junior Poster

@andre, so doing something like this will make a good practice?

Set rs = New Adodb.Recordset

Set rs = Nothing

rs.open ....

I think not.

Don't get me wrong because I am just giving advice.

jhai_salvador 48 Junior Poster

In your code, you are still using the rs object, but you've destroyed it before it was use using this code.
Set rs = nothing
You must only destroy objects when you are not going to use it anymore.

jhai_salvador 48 Junior Poster

What is the error prompt? What line # did it occur?..

jhai_salvador 48 Junior Poster

Please remove all your "On Error Resume Next" and come back here again.

Make sure all your objects (buttons, textboxes, combo boxes, etc..) exist in the form.

jhai_salvador 48 Junior Poster

First thing is, remove the "On Error resume Next" so you could see error prompts, and then you can come back here and show us the error description.

jhai_salvador 48 Junior Poster

How about visiting my site, you can download my open source project there and learn from it. Thanks

jhai_salvador 48 Junior Poster

Check your listview property like, if Listview propert view is Report style (detailed style) then make sure you have column headers.

ListView1.ColumnHeaders.Clear
ListView1.ColumnHeaders.Add "ID"
ListView1.ColumnHeaders.Add "Username"
ListView1.ColumnHeaders.Add "Password"

Above code is just sample, so please try it out. Thanks

jhai_salvador 48 Junior Poster

Google it.. Buy it.. download it..

jhai_salvador 48 Junior Poster

I think i need to correct that code :)

Dim i as Integer
Dim myString as string

For i = 1 to Len(Text1.Text)
 If Mid(Text1.Text,i,1) <> " " then
 myString = myString & Mid(Text1.Text,i,1) '<-- Corrected this one...
 EndIf
Next i
jhai_salvador 48 Junior Poster

@Andre. Thanks.

jhai_salvador 48 Junior Poster

You can use loops

dim i as integer
dim myString as string

for i = 1 to len(text1.text)
 if mid(text1.text,i,1) <> " " then
 myString = myString & mid(text1.text)
 endif
next i

you can do something like that. Thanks

AndreRet commented: Nice alternative. +4
jhai_salvador 48 Junior Poster

Still no replies.. :sad: Please test the previously attach vb6 project in Windows 7, and Vista so I have an idea if it works or not..

jhai_salvador 48 Junior Poster

:-O ow.. Nobody replies yet..

Okay, I have updated the code and used DAO 2.5 / 3.51 instead of the API, I also attached a sample VB6 app with a compiled version and an Access 2007 database so it can be tested.

Please test this application on your WINDOWS 7. This will just create an ODBC connected, and thats it. I just want to know if this will work under Windows 7.

I will be waiting for your replies. Thanks.

jhai_salvador 48 Junior Poster

Guys, does anyone of you have Windows 7?...

Okay, here is my problem can you kindy test this code in windows 7.

Public Sub createAccessDSN(MDBPath As String, xDescription As String, xDSN As String, xUID As String, Optional xPassword As String)
    'Creating the DSN

#If Win32 Then
   Dim intRet As Long
#Else
   Dim intRet As Integer
#End If

Dim strDriver As String
Dim strAttributes As String


strDriver = "Microsoft Access Driver (*.mdb, *.accdb)"

strAttributes = strAttributes & "DESCRIPTION=" & xDescription & Chr$(0)
strAttributes = strAttributes & "DSN=" & xDSN & Chr$(0)
strAttributes = strAttributes & "PWD=" & xPassword & Chr$(0)
strAttributes = strAttributes & "UID=" & xUID & Chr$(0)
strAttributes = strAttributes & "DBQ=" & MDBPath & Chr$(0)

intRet = SQLConfigDataSource(vbAPINull, ODBC_ADD_SYS_DSN, _
strDriver, strAttributes)

' DSN created
End Sub

Heres how to use it.

'Create a DSN for Reports
Call Data.createAccessDSN("DatabasePath.mdb", "DBDSN", "ANYTHING", "Admin", "Optional")

I don't know if a this is working in Windows 7 because I don't have a Windows 7 to test it. So please help me to test this code or if you have other ways in creating a DSN using VB, please kindly help me.

and in crystal report 8.5 installed on Win7, what is the cause of "Server has not been opened" error?...

jhai_salvador 48 Junior Poster

I will help you for a price.. I will code it if you want to.. :D

jhai_salvador 48 Junior Poster

How about I code for you with a price? :D

How about showing us what you have done so far for this project?..

jhai_salvador 48 Junior Poster

Depends on what you have used. If you have used a feature elusively only in say XP or only in Vista, you might have a problem in 7. Some other features though like shadow drawing in Vista or 7 will not generate errors at all, it will only not show the shadows in XP for instance. There is unfortunately no specified list available of what is exclusive to XP, Vista and 7. You have to play around testing on the different OS's if you have it available to you. Once you start programming in win7 though and use its features, it is almost certain that your app will not run on XP and vice versa, unless you run XP mode in win7.

I am busy compiling a help file and will post it soon eneough for readers that want to know whether their apps will work on other OS's.

:D wow.. Thanks a lot. I will wait for that help file. I cant test out my app in other OS cause I don't have Vista and windows 7.

jhai_salvador 48 Junior Poster

Do the following.
1. Add a Timer on the Form
2. Set the Timer Enable, Interval = 1000
3. Add this code

Private Sub Timer1_Timer()
Me.Caption = Format(Now, "s")
End Sub

This code will show you the current time seconds in the form caption or you might want to research on the GetTickCount API function.

jhai_salvador 48 Junior Poster

As far as I know it should. I have tried a small app a while back on an apple mac and it worked fine. I suppose you just need to ensure that all the run time files for vb6 is included AND if any reference has been made to Windows API, include those as well.

Let us know if you found more to this.

if I used API in my application, then install that application it in Windows 7, will it work fine as long as I include its dll?...

jhai_salvador 48 Junior Poster

What report are you using? Is it DataReport? Crystal Report? Active Report?..

jhai_salvador 48 Junior Poster

Nice way of manipulating strings. There are some easier ways to encrypt and decrypt though. Nice code as well.

:) Thanks. Hope more will learn from it (Manipulating strings)..

jhai_salvador 48 Junior Poster

You want to clear a textbox?..
use this..

Text1.Text = ""
jhai_salvador 48 Junior Poster

Try adding a field to your database where the equipment gets booked out stating "Available" or "Not Available" When you check the availability through data, book it out if the field says "Available" or not...

Wow, I think this will solve your problem.. I misread the problem.. :D

jhai_salvador 48 Junior Poster

Your welcome :) how about marking as solve your previous thread if its already solved... http://www.daniweb.com/forums/thread311721.html

jhai_salvador 48 Junior Poster

This is my Cogwheel Encryption Method to encrypt and decrypt strings.

Wheel1 is Replace by Wheel2 when Encrypting and Wheel2 is Replace by wheel1 when you are decrypting...

To Encrypt a string, just call the EncryptString function

Text2.Text = EncryptString(Text1.Text)

To Decrypt a string, just call the DecryptString function

Text2.Text = DecryptString(Text1.Text)

This is my First Code Snippet so hope you like it.

AndreRet commented: Nice for a first time post Jhai. +3
jhai_salvador 48 Junior Poster

How about adding a Access Right Modules for your users, where you will have a set of function that a certain user can and cannot access.

jhai_salvador 48 Junior Poster

its VB.NET and not VB6.. All you have to learn is String Manipulation and their function like Text Replace, Mid, Left, Right...

jhai_salvador 48 Junior Poster

First, When someone solves your problem you must mark it as Solved... Thanks.

Second, in your code, I didn't see where do you want to show the Total for it. Will it be showed in Textbox? in Label?..

Assigning Value in a Textbox Control using Text Property

Text1.Text = readout
or
Text1.Text = subtotal

Assigning Value in a Label Control using Caption Property

Label1.Caption = readout
or
Label1.Caption = subtotal

you can do it something like that...

jhai_salvador 48 Junior Poster

How about showing us what you've done first so we can take a look at it..

jhai_salvador 48 Junior Poster

"Should not use Google map or any application with internet oriented. "
- You need a LARGE MAP IMAGE that can be zoomed in / Out if you don't want to use Google map...

"if anyone having these kinds of project please post it.. thanks for all those helping"
- how about showing your code first so we can take a look at it...

jhai_salvador 48 Junior Poster

thanks Jhai u were a great help.
to Abu i had declared A=16%

Your welcome, hope its solves your problem...

jhai_salvador 48 Junior Poster

Thought it was a real challenge..... :)

jhai_salvador 48 Junior Poster

If the database is Access then all you have to do is Share its folder and make it writable so it can be access through lan connection...

jhai_salvador 48 Junior Poster

You can use variables to hold each value you need. You can make it something like this...

Dim Var1 as Double
Dim Var2 as Double
Dim SubTotal As Double

Var1 = CDbl(Text1.text) * 0.16
Var2 = 0.16
SubTotal = Var1 + Var2 
'Label1 Shows the value of SubTotal
Label1.Caption = SubTotal

Var2 is the tax code e.g 16%, just like that.. Hope it helps...

jhai_salvador 48 Junior Poster

Your welcome.. :)

PLease mark the thread if your problem is solve...

jhai_salvador 48 Junior Poster

First, if you cant update due to Relationship Integrity, you must add data by grouping it first, and;

What is your Foreign Key and Primary Key in Inventory Transactions table?..

Does the Value from rs("part") is a Foreign key and Does the Value you are adding is existing to its Primary Table?..

Does rs("transaction type") is a Foreign key also has a reference Table?..

Does rs("Technician") is a Foreign key also has a reference table?..

jhai_salvador 48 Junior Poster

Creating a DLL? Well its just a Compiled Class...
Try playing with this..

Create a New ActiveX Dll Project, then on the Menu > Click Add-Ins > Add-In Manager

A window will show and Double Click VB 6 Class Builder Utility

To use the Class Builder, in the Menu, Click Add-Ins > Class Builder Utility

Just play with it by adding Property, Event, Enum and Methods...

You can add the Compiled class (DLL) by going to Menu > Project > References

Just Browse it..

Then once its added, you can use it by doing something like this

Dim xClass as New Class1

xClass will be the Variable and Class1 will be your DLL (Class)..

Hope it Helps...

jhai_salvador 48 Junior Poster

you want to read a line of text from a text file then import it to access?..

you can use the OPEN function

Dim f as Integer, ReadedLine as string, Content as string
f = FreeFile()
Open "YourFile.txt" For Input as #f
Do While EOF(f)
Line Input #f, ReadedLine
Content = Content + ReadedLine
Loop
Close #f

Something like that..
Then Content variable will have all readed line from yourText.txt, all you have to do is save it to Access....

Hope this helps you...

jhai_salvador 48 Junior Poster

Or you can use the %

Adodc2.Recordset.Filter = "[book]='%" & b & "%'"
jhai_salvador 48 Junior Poster

Use the DateDiff Function to determine the interval between 2 dates or time.

Dim Bday as Date
Dim dVar as string, dAge as string

dAge = DateDiff("yyyy",bDay,Date) 'Shows your Age
dVar = DateDiff("d",bDay,Date)    'Shows # of Days between bDay and the Date

Try it. Hope it works for you.

jhai_salvador 48 Junior Poster

you need a computer that is a touchscreen... ex. SENOR POS ROBOT.. just google it....

jhai_salvador 48 Junior Poster

Thank you for answering it. Ill just visit those sites later.
for the meantime, I'm gonna try this code.

Public Sub ConnectViaIP(TempConn As ADODB.Connection, strDbname As String, _
                             strServerIP As String, _
                             Optional strUID As String, Optional strPWD As String)
On Error GoTo err:
Set TempConn = Nothing
Set TempConn = New ADODB.Connection
TempConn.Open "Provider=SQLOLEDB.1;" & _
           "Network Library=DBMSSOCN;" & _
           "Data Source=" & strServerIP & ",1433;" & _
           "Initial Catalog=" & strDbname & ";" & _
           "User ID=" & strUID & ";" & _
           "Password=" & strPWD
TempConn.CursorLocation = adUseClient
Exit Sub
err:
MsgBox err.Description
End
End Sub

Do you think this code will work?.. :) this will be a DSN less connection right?..

jhai_salvador 48 Junior Poster

Yoe guys, need your help..

I want to know on how to setup my client computers and the server so they can connect to sql server 2005 Developer Edition.

Client computers are Windows XP.
Server is Windows Xp installed with a SQL Server 2005.

They are on the same Workgroup.

Now how will I connect my Client to server using ODBC, and Use that client ODBC so my Client Application can connect to the Server database.

Hoping for your positive response.