abelingaw 69 Posting Whiz in Training

Uhm ok. I am near n finishing my project (Payroll System)

But im having problems regarding some codes and i am only able to fix some of it

My real problem is the saving of picture in the database.

Have the code, works well but doesn't save the pic as a binary (in my database).

If anyone would be so kind to debug my project.

I'll just upload it

Thanks.

abelingaw 69 Posting Whiz in Training

:-O Some of the codes are kinda new for me.. :confused:

Uhm i'll try to figure out how to make this work for my program sir..

Thanks anyway, i'll come back at you if i have further needs

:$

Im using Windows XP SP2

abelingaw 69 Posting Whiz in Training

I have finish coding some of my Payroll Program modules.
But im having a problem on the log-in.

I would like the log-in to determine the type of the user logging in, a User or Admin
(Level Access of course).

If it is a User, all command buttons in every form will be disable, only cmdExit is enabled.

While for Admin, as assual, all is accessible.
Of course, the type still based on my DBASE Recordset (UserType Column)

I really dont know where or how to start the code.
Any ideas..?

Thanks in advance

abelingaw 69 Posting Whiz in Training

http://www.daniweb.com/forums/thread319130.html

Please start your own thread. Dont bump

abelingaw 69 Posting Whiz in Training

Do you mean Creating an Installer of a program created in VB6..?

Create first an exe of the project before proceeding.

1. Close ms vb6.0 ide
2. Click start>
-programs->
microsoft visual studio 6.0->
microsoft visual studio 6.0 tools->
package and deployment wizard
3. Click browse to locate ur project file(.vbp)
4. Click package
5. Click yes to start the recompilation process
6. In package type select standard setup package and click next
7. Select the destination where u want to create the package folder for ur project.this folder will contain all the supported and main application files required to install ur apps in some other client machine.
8. Click yes to create the folder if it doesn't exist and click next
9. The next list that will come will display all necessary files to build the setup.click add to insert some other files from ur project to the said list.if u any access database file,click this button,locate ur db file and click open to add the file to the list.this list will also help u to remove any unnecessary files that u donot wish to install in the target machine with apps.u can also add help files(if any) for project from this option.but do not ever try to remove the .dll,.ocx,.lib or .exe files.click next
10.if u want ur setup becomes a standalone package select single cab otherwise if u want …

abelingaw 69 Posting Whiz in Training

Can anyone tel me where to microsoft vb 6.o. iI couldn find it in the miocrosoft.com.pls suggest anyother sites.

If u can give me a site that allows me top upload 300MB file size at once, i can upload the installer for you.

Please dont bump threads, start your own.

abelingaw 69 Posting Whiz in Training

I have fix the problem.

But why is it that the record that is deleted is the first one (top) and not the one i selected (highlighted)..

On Error GoTo err
  
  Call con
    
    Dim intYN
    
    Set rs = New ADODB.Recordset
    
    With rs
    
        If .State = adStateOpen Then .Open
        
        rs.Open "Select * from Users", Dbconn, adOpenKeyset, adLockPessimistic
    
    intYN = MsgBox("You are about to delete a record." & vbCrLf & _
        "If you click Yes, you won't be able to undo this delete operation." & _
        vbCrLf & vbCrLf & _
        "Are you sure you want to delete this record?", vbQuestion + vbYesNo, "Confirm Delete")
        
    If intYN = vbNo Then Exit Sub

    
    Dbconn.Execute "Delete From Users where UserName ='" & DataGrid1.Text & "'"


    .Delete
    
    Call GetUsers
    
    txtName.Text = ""
    txtPass.Text = ""
    txtConfirm.Text = ""
    cboPriv.Text = ""
    MsgBox "The Record has been deleted.", vbInformation
    
        .Close
        
    Exit Sub
    
err:
    MsgBox err.Description, vbCritical
    
End With

Any code for that..?

abelingaw 69 Posting Whiz in Training

Ok, i have this form which contains a Datagrid control, i have fix the 1st problem i encountered which is how to connect it to my Dbase to display the content of one of my tables.

Now my problem is, i cant delete records in my Dbase thru selecting it in the Datagrid directly then pressing my Delete command button.

I get the error "OPERATION IS NOT ALLOWED WHEN THE OBJECT IS CLOSED".
I know it has something to do with my Dbase connection code/s, but cant really figure it out.

Heres my form pic:

http://img818.imageshack.us/img818/200/sysuser.jpg

And heres my code for the Delete Command Button:

Private Sub cmdDelete_Click()


  On Error GoTo err
  
    
    Dim intYN
    
    Set rs = New ADODB.Recordset
    
    With rs
    
        If .State = adStateOpen Then .Close
    
    intYN = MsgBox("You are about to delete a record." & vbCrLf & _
        "If you click Yes, you won't be able to undo this delete operation." & _
        vbCrLf & vbCrLf & _
        "Are you sure you want to delete this record?", vbQuestion + vbYesNo, "Confirm Delete")
        
    If intYN = vbNo Then Exit Sub

    
    Dbconn.Execute "Delete From Users where UserName = DataGrid1.Text"

    Call GetUsers
    
    txtName.Text = ""
    txtPass.Text = ""
    txtConfirm.Text = ""
    cboPriv.Text = ""
    MsgBox "The Record has been deleted.", vbInformation

    Exit Sub
    
err:
    MsgBox err.Description, vbCritical
    
End With

End Sub

I think the problem is in Line 24 (i think)..

Can u check it? Thanks

abelingaw 69 Posting Whiz in Training

SOFTWARE:
If i install a Payroll System made from VB6, would this be enough for its requirements..?


SOFTWARE:

Windows XP (Any Service Pack)
MS Access 2003 or Higher

HARDWARE:

Hardware Requirements

* 200 Mhz Processor
* 128 Mb RAM or Higher
* 100GB SATA (Serial Advanced Technology Attachment) Hard Drive
* 5400 RPM hard disk drive
* DirectX 9 capable video card running at 1024 x 768
* DVD-ROM Drive


Can u suggest any other/better specification (Windows XP SP3 / Windows 7)
Really dont know much about this Specs thingy..

abelingaw 69 Posting Whiz in Training

Wow, i didnt know about a code like this haha, im such a beginner.

Regarding this part sir

#
If TypeOf Control Is TextBox Then
#
Control.Text = vbNullstring 'We do not use ""
#
End If

the exception is my txtIDNo (for employee ID) A null value cannot be allowed

of course with the code you also helped me with..

Public Sub InitData()

Dim dbX As ADODB.Connection
Set dbX = New ADODB.Connection
dbX.CursorLocation = adUseClient
dbX.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source=" & App.Path & "\Database.mdb"

    Dim rsX As ADODB.Recordset
    Set rsX = New ADODB.Recordset
    'If rsX.State = adStateOpen Then rsX.Close
 
    rsX.Open "Select * from EmpRecord", dbX, adOpenStatic, adLockOptimistic
    If rsX.BOF = True Or rsX.EOF = True Then
 
       'No records
       txtIDNo.Text = "10000"
 
       rsX.Close
       Exit Sub
          Else
       rsX.MoveLast
 
Dim xIdNo As Integer
 
       xEmpID = rsX!EmpID
       xEmpID = xEmpID + 1
       txtIDNo.Text = xEmpID
 
       rsX.Close
     End If
End Sub

How can i use the code without clearing the txtIDNo.?

abelingaw 69 Posting Whiz in Training

db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source=\\192.168.0.199\MyOtherPcName\Database.mdb" 'Here you need to get the Ip address of the other pc, enter the pc name where MyOtherPcName is.

One question sir, using this code, would i be able to access the Database no matter where i put it (any drive or folder) on the PC unit..?

abelingaw 69 Posting Whiz in Training

Still got an error.

Error message is:

Arguments are of the wrong type, are out of range or are in conflict with one another.

I dont know if it is on the Database (datatype) or my code.

Any way, I'll just post the entire code for my Add Employee Form

Can u look at it, Thanks.

Dim process As String
Private Sub cmdAdd_Click()

process = "add"

Call Add
Call InitData

End Sub
Private Sub cmdCancel_Click()

Call Form_Load
cmdSave.Enabled = False
cmdAdd.Enabled = True

End Sub

Private Sub cmdClose_Click()

Unload Me

End Sub

Private Sub cmdSave_Click()

On Error Resume Next

cmdAdd.Enabled = True

Call con

If rs.State = adStateOpen Then rs.Close

    rs.Open "Select * from EmpRecord", cn, adOpenKeyset, adLockPessimistic
    
        If txtIDNo.Text = "" Then MsgBox "Please enter Employee ID number.", vbInformation, "Information": txtIDNo.SetFocus: Exit Sub
        If txtfname.Text = "" Then MsgBox "Please enter First Name.", vbInformation, "Information": txtfname.SetFocus: Exit Sub
        If txtmname.Text = "" Then MsgBox "Please enter Middle Initial.", vbInformation, "Information": txtmname.SetFocus: Exit Sub
        If txtlname.Text = "" Then MsgBox "Please enter Last Name.", vbInformation, "Information": txtlname.SetFocus: Exit Sub
        If cboGender.Text = "" Then MsgBox "Please Select Gender.", vbInformation, "Information": cboGender.SetFocus: Exit Sub
        If cboStat.Text = "" Then MsgBox "Please Select Status.", vbInformation, "Information": cboStat.SetFocus: Exit Sub
        If txtAddress.Text = "" Then MsgBox "Please enter Employee's Address.", vbInformation, "Information": txtAddress.SetFocus: Exit Sub
        If cbodept.Text = "" Then MsgBox "Please enter Department.", vbInformation, "Information": txtDept.SetFocus: Exit Sub
        If txtPost.Text = "" Then MsgBox "Please enter …
abelingaw 69 Posting Whiz in Training

Thanks for the replies.

I'll try this when i'm at school so i wont closed this topic yet, till it worked.

:)

Thanks again sir.

abelingaw 69 Posting Whiz in Training

Here i am again.

I would like to to know how to use/connect a database for my login program to a
Database from another computer.

I will be using 2 pc unit and connect them with a CROSSOVER connection UTP Ethernet cable.

My Dbase will be on the other unit while my app will be on the other one.

My questions are:

What are the Components i will use for my VB App?

Do I have to run my Program on both unit?

Do i have to install VB6 on both unit?

And would i have to use this code?

Set db = New ADODB.Connection
        db.CursorLocation = adUseClient
        db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source=" & App.Path & "\Database.mdb"
    
    Set rs = New ADODB.Recordset
        rs.Open "select * from Users where UserName = '" & txtUser & "'", db, adOpenStatic, adLockOptimistic

How is the code if the source (Dbase) is on another PC..

Really need help on this one. ASAP :'(

abelingaw 69 Posting Whiz in Training

Ok here's my problem.

What i wanted to do was that if i save the value i enter on my txtbox (txtIDNo) and saves it to my database, the default value should automatically adds 1 or + 1 on it.

I set the field data type to Number and the default value to 10000. I dont want to use Autonumber because i wanted to set the default value.

If i save a new record, the default value 10000 should become 10001 for the new record.
But i dont really know why my code always get an error.

Here's the code:

Public Sub InitData()
On Error GoTo err:
    If rs.State = adStateOpen Then rs.Close
    
    rs.Open "Select * from tblEmp", cn, adOpenKeyset, adLockPessimistic
    If rs.EOF = False Then
        rs.MoveLast
        Me.txtIDNo.Text = rs.Fields("EM_ID").Value + 1
    Else
        Me.txtIDNo.Text = 10000
    End If
    Exit Sub
err:
    MsgBox err.Description, vbCritical, "Error"
    Set rs = Nothing
End Sub

Please, i really dont know what the problem is. Thanks

abelingaw 69 Posting Whiz in Training

I didn't remove any devices sir. The keyboard wont function as well

after POST (even num lock). I only have 1 module sir so cant really

take it out. The 3 fans are all fine.

I dont really have the CD (borrowed only).

abelingaw 69 Posting Whiz in Training

I cant use my computer anymore. Everytime I turn it on blank screen
follows the POST. I tried clearing the CMOS but didn't work.

I tried Reinstalling windows but after the message
"Windows is checking ur Hardware...." the screen goes blank and hangs. Cant even enter Safe mode (F8 key).

BIOS are correct. Also remove the Battery and put it again after a few munites but only reset the date and clock and didnt help at
all.

.Windows XP SP2
.AMD Athlon
.GeForce
. 2.8 Ghz

What should I do?
Tnx in advance!

abelingaw 69 Posting Whiz in Training

Ok! Now i have done it. The prblem is that i dont know how to do a switch.

I mean after the program is executed and finish, How do I enable it to ask the user if he wants another try. If yes, the prog starts again and if no, it exits.

O and 1 more thing, the prog (window) closes after i had made the choice (ascending or descending).

Heres my Code:

#include <stdio.h>

int main(void)
{
int a[10], i=0, j=0, n, t;

printf ("\n Enter the no. of elements: ");
scanf ("%d", &n);
printf ("\n");

for (i = 0; i <n; i++)
{
printf ("\n Enter the %dth element: ", (i+1));
scanf ("%d", &a[i]);
}

for (j=0 ; j<(n-1) ; j++)
{
for (i=0 ; i<(n-1) ; i++)
{
if (a[i+1] < a[i])
{
t = a[i];
a[i] = a[i + 1];
a[i + 1] = t;
}
}
}

printf ("\n Ascending order: ");
for (i=0 ; i<n ; i++)
{
printf (" %d", a[i]);
}

printf ("\n Descending order: ");
for (i=n ; i>0 ; i--)
{
printf (" %d", a[i-1]);
}

return 0;
}
abelingaw 69 Posting Whiz in Training

A program where u have a 10 input number and enbles u to choose wether the output is in asecnding or descending order. Thanks in advance!!