abelingaw 69 Posting Whiz in Training

The only easy way I can think of this is to put another button with the same Caption as the first one over it.

Try it! :-)

abelingaw 69 Posting Whiz in Training

Can you show what you have so far?

abelingaw 69 Posting Whiz in Training

I'm assuming you want to use the application using the same database? If so,

THIS might give you an idea.

abelingaw 69 Posting Whiz in Training

If you really want to have your own domain, you need to pay.

But there are free webhosting services available, but the domain name would still include that sites domain.

say a webhost with a domain name

www.sample.com

If you use their free hosting, you'll be given a domain name of

www.yourgivendomain.sample.com

or something like that.

abelingaw 69 Posting Whiz in Training

Try using module for your database connection.

i.e.

Dim dbcon

dbcon = App.Path & "\Database\Main.accdb"

then make sure that you always include your database file with the Folder of your file/s.

If it is inside another folder, then:

    Dim dbcon

    dbcon = App.Path & "\Foldername\Database\Main.accdb"

And for the latest connection strings, please check THIS

Enjoy!!

abelingaw 69 Posting Whiz in Training

If the datatype in your database is Number, maybe try declaring it as integer in the program.

Dim a as Integer

rs.MoveLast
a = rs.Fields(0)
a = a + 1
abelingaw 69 Posting Whiz in Training

Give more information on your problem.

abelingaw 69 Posting Whiz in Training

Would be implementing a system which database is shared accross LAN nextweek.

Scenario:

All 5 units are of the same OS (Windows XP)

  • 1 Server
  • 4 Client

Database is MSAccess 2007

  • (but 2003 format in case of compatibility issues)

Now here's my checklist:

  • Make sure all units are under the same workgroup (name)
  • Make sure the IP addresses belongs to the same network
  • Enable file sharing on all units
  • Make sure the folder where the database resides is shared

Database connection:

db.ConnectionString = "Data Source=" & App.Path & "\192.168.0.1\C:\Windows\Database.mdb"

Now my questions are:

  • Is my database connection correct? (I'm planning to put the database in the Windows folder)
  • Can I use the Server unit Computer Name instead of its ip address?
  • Using the connection above, are the client units be able to save on the database even if the file/folder is hidden?
  • Am I missing some things?

Thanks.

abelingaw 69 Posting Whiz in Training

Or you can also use third party programs.

Try googling "Setup Factory"

abelingaw 69 Posting Whiz in Training
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        With Form2
            .txtform2.Text = txtform1.Text
            .Show()
        End With

    End Sub
End Class
abelingaw 69 Posting Whiz in Training

Hmmm, seems like your using VB2008/10.

Well, heres an idea:

AnotherWindow.Textbox1.Text = MainWindow.Textbox1.Text

Or you can use With, say:

With AnotherWindow
    .Textbox1.Text = MainWindow.Textbox1.Text
End With

Is this?

abelingaw 69 Posting Whiz in Training

Ok.

Say i have this column in a table in my database:

IDNo - the category where I would base
Score - where the value from a textbox would be saved.

My textbox number corresponds to the record on column IDNo.
i.e textbox1 corresponds to the first record on column Idno, textbox2 is to the second record and so on.

But the value of the textboxes is saved on the column score which also refers to the number on column IDNo.
So, if my textbox1 value is 10 and textbox2 is also 5, then on my DB appears:

IDNo        Score      

1             10           - from textbox1
2             5            - from textbox 2
abelingaw 69 Posting Whiz in Training

I've done programs to save values to a dbase from a certain control, but done one by one.

Scenario:

  • There are 7 textboxes where values are entered.
  • There are also 7 rows (but in one column only) for each values when save button is clicked.

Problem:

  • How to save values from each textbox to their respective rows based on a category (i.e. gender or ID number) ?

Here's my code - so far

.Open "Select * from Tabulation where Gender = " & lblmale.Caption, db, adOpenKeyset, adLockPessimistic
                .AddNew
                .Fields("Jeans_M").Value = txtm1.Text
                .Fields("Jeans_M").Value = txtm2.Text
                .Update
                MsgBox "Data successfully save.", vbInformation, "Information"

            .Close

But honestly, this would just put the values from the 2 textboxes in a random row on the Jeans_M column.

Code snippets will do just fine (but better with explanation)
Thanks.

abelingaw 69 Posting Whiz in Training

I'm having a little problem regarding this log-in program.

#include<stdio>
#include<conio>
#define p printf
#define s scanf

main()
{

    char pass[20];
    char user[20];

    clrscr();

    p("\nEnter your username: ");
    s("%s", user);

    p("\n\nEnter your password: ");
    s("%s",  pass);

    if(user=="abel" && pass=="pass")
        p("\nW E L C O M  E !!");
    else
        p("\nINVALID INFORMATION!!");

  getch();
  return 0;
}

Even if I enter the correct username (user) and password(pass), it would still goes directly to the else statement. Logic error, or am I missing something.

Thanks!!

abelingaw 69 Posting Whiz in Training

Do: 2nd person above me says.

Check if some reference missing, click the item then see description (name of the missing DLL if any)

Otherwise, install SP'c 5 and 6

abelingaw 69 Posting Whiz in Training

Sorry, I don't know where to post this one.

I would like to try executing an SQL Injection on a site (offline) i created with wamp.

Just like to test the security of my site and try sql injection at the same time.

If this kind of post isn't allowed, then its for deletion. Thanks

abelingaw 69 Posting Whiz in Training

You can either use DataEnvironment or do what arvin said.

Use rptTextbox control and set the datafield. Regarding the connection, use SQL statements on the button that shows(print) the datareport.


@jovicmon21, please don't highjack someones thread, Start your own.

abelingaw 69 Posting Whiz in Training
Private Sub Text1_KeyPress(KeyAscii As Integer)
    Select Case KeyAscii
          Case 48 To 57, 8 
        Case Else
          KeyAscii = 0 
          Msgbox "Your Message Here"

    End Select
End Sub
abelingaw 69 Posting Whiz in Training

Try running CMD as Administrator if you are using Windows 7.

abelingaw 69 Posting Whiz in Training

I just don't know how to have the amount showing on the first form to always be portrayed in a label in the second form. Please help!

You mean showing the same amount of a label in form 1 to a label in form 2?

If so, then have a look at this:
label.zip

abelingaw 69 Posting Whiz in Training

Form Property?

Borderstyle > then choose if Fixed or Resizable

abelingaw 69 Posting Whiz in Training

Project > More ActiveX Designers > Data Environment ?

Are you using Portable or Full and what version ?

abelingaw 69 Posting Whiz in Training

Did you mean showing a specific database field or column?

Have you tried using rptTextbox?

abelingaw 69 Posting Whiz in Training

Got this one solved.

The problem was in my SQL statement.

Query = "Select * from TimeLog " & _
              "where EM_Name = '" & LblEmployeeName.Caption & "' " & _
              "AND IN_AM <> null and OUT_AM <> null " & _
              "AND IN_PM <> null and OUT_PM  <> null " & _
              "AND Date_LOG = '" & Format(Date, "YYYY-MM-DD") & "'"

Thanks..

abelingaw 69 Posting Whiz in Training

Try to do what JX said.

Maybe your table login doesn't exist or misspelled.

Or try this:

SQL = "SELECT * FROM [login]"

Oh one more thing, do you have this statement?

Dim SQL as String

Cheerz!!

abelingaw 69 Posting Whiz in Training

Just wanna know how to add all values of a data report column using rPtFunction.


Example:

SALARY: DEDUCTIONS: NET:

1000.00 300.00 700.00

Haven't tried this one before.

Thanks in advance.

abelingaw 69 Posting Whiz in Training

Error is:

1. The messagebox appears even if the database is empty and I'm trying to save a
new record in it.

Which should not supposed to be cuz the database is EMPTY.

abelingaw 69 Posting Whiz in Training

I'm having problem trying to find out what is wrong with a code.
Here's what it is supposed to do.

1. The messagebox should only appear if a record already exist in the database
2. If there is no record of the same information, then it would save the new record

Here's the code that creates the error (Logic ?):

DBConnection "Database.mdb"
    
    With RecSet
    

        .Open "Select * from TimeLog where EM_Name = '" & _
         LblEmployeeName.Caption & "'", DBLink, adOpenDynamic, adLockOptimistic
    
       
        If .EOF = False Then
            MsgBox "Record already exist.", vbExclamation, "Prompt"

            DBLink.Close
            Exit Sub
        End If
        
        .Close
    End With

And the rest:

With RecSet
    
              
        .Open "Select * From TimeLog where ID = " & FrmMainDTR.txtEIDN.Text & " and Date_LOG = '" & Format(Date, "YYYY-MM-DD") & "'", DBLink, adOpenDynamic, adLockOptimistic
               
        If .EOF = True Then
            .AddNew
            
            .Fields(10) = FrmMainDTR.txtEIDN.Text
            .Fields(1) = LblEmployeeName.Caption
            .Fields(2) = Format(Date, "YYYY-MM-DD")
            
        End If
        
        
   'THE FOLLOWING CODE IS IGNORED AND A USER CAN LOG IN/OUT MULTIPLE TIMES
   
   '(Turned it to Text) and it now works well
        
        If LblLogType.Caption = "In [AM]" And IsNull(.Fields(3)) = True Then
             .Fields(3) = sts2.Panels(2).Text
            MsgBox "The fingerprint was verified and user was logged in at " & sts2.Panels(2).Text & ".", vbInformation, "FingerPrint Verification Successful"
        ElseIf LblLogType.Caption = "In [AM]" And IsNull(.Fields(3)) = False Then
            MsgBox "The user has already Logged In for the Morning"
        End If
        
        If LblLogType.Caption = "Out [AM]" And IsNull(.Fields(4)) = True Then
            .Fields(4) = sts2.Panels(2).Text
            MsgBox "The fingerprint was verified and …
abelingaw 69 Posting Whiz in Training

Try also to use CODE tags. Thanks

abelingaw 69 Posting Whiz in Training

A revision of BitBIt's code:

If Text1.Text <> "q" or "Q" Then
    MsgBox "INVALID COIN!PLEASE INSERT COIN in Q,D and N ONLY!", vbCritical, "INSERT COIN"
    Exit Sub
End If

It accepts the specified letters in UCase and LCase.
Or you could use ASCII code equivalent of each letters.

abelingaw 69 Posting Whiz in Training

You can use key trapping by their corresponding ASCII equivalents and Case statements.

Example:

Private Sub Text1_KeyPress(KeyAscii As Integer)

Select Case KeyAscii

 Case 65 To 90, 8, 32, 39 ' A-Z and backspace and space Let these key codes pass through
 Case 97 To 122, 8 'a-z and backspace Let these key codes pass through
        
 Case Else
        
        KeyAscii = 0 ' Traps other characters
        
    End Select

Try to find the complete ASCII table. Would be useful. Cheers :)

abelingaw 69 Posting Whiz in Training

You can just press CTRL + ALT + DEL.

Find the process that is blocking you to delete that file then End Task it.

Yeah, Unlocker works too.

abelingaw 69 Posting Whiz in Training

Here's to give you an idea.

Dim xIdNo As Integer
Dim xEmpID As Integer
 
       xEmpID = rsX!EmpID        'xEmoID var contains the value of your ID column
       xEmpID = xEmpID + 1       'Adds 1 to the original value of your xEmpID var
       txtIDNo.Text = xEmpID     'Displays it in a textbox

       rsX.Close                 'Closes recordset
   
    Exit Sub

Much better if you create a Sub for this then call it on your Add button code.
And don't set the textbox to invisible so you can see the effect.

Goodluck

abelingaw 69 Posting Whiz in Training

I originally have a Visual Basic 6 App on my PC, and tried to update it with SP5, but I got a failed installation.

And after that, I wasn't able to use the VB6 app again, because it gives me an error.
I tried to uninstall it but cannot see it on the list of Programs on the control panel.

And when I tried to re-install it, instead of the Professional Edition which I have, it says Working Model.

Already removed the registry entries of the original VB app and even cleared temp folder.

But to no avail.

I'm using Windows 7 Ultimate 32-bit

Thanks in advance.

abelingaw 69 Posting Whiz in Training

I am trying to display an alert box using javascript in my login php file.

When a user logged in using a wrong username or password, then a messagebox will display.

This is what i have so far:

$query="SELECT * FROM info WHERE username ='$user' && password ='$pass' ";
		  $res=mysql_query($query);
		  if (mysql_num_rows($res) == 0) {
		           echo"<script language="javascript">window.alert('Invalid password.')</script>";
				   echo "<br>";
		     }
		   else {
				   echo "Access Granted";
				   echo "<br>";
		         }

Can't figure it out.

abelingaw 69 Posting Whiz in Training

Done but still..

Getting the message in the echo part.

echo "Wrong Username or Password";

I'm using correct username and password from DB and DB name and tables are declared correctly

abelingaw 69 Posting Whiz in Training

W3 Schools

Ex Designz

Not much but good..

abelingaw 69 Posting Whiz in Training

I'm having problem with my login php files.

I don't know if it is in the passing of values from inputboxes or connection with my database records.

log-in code:

<td align="right" width="130px">
    Username:
</td>
<td><input type="text" size="40" id="username" class="inputbox" /></td>
 </tr>
<tr>
<td align="right">
 Password:
</td>
<td><input type="password" size="40" id="password" class="inputbox" /></td>

Login checking code:

$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
$result=mysql_query($sql);

$count=mysql_num_rows($result);

if($count==1){
session_register("myusername");
session_register("mypassword");
header("location:login_success.php");
}
else {
echo "Wrong Username or Password";

And the line producing the error is this:

$myusername=isset($_POST['myusername']) ? $_POST["myusername"] : ""; 
$mypassword=isset($_POST['mypassword']) ? $_POST["mypassword"] : "";

Error:

Fatal Error:Undefined index: myusername
Undefined index: mypassword

The myusername in POST method is same name of my inputboxes on the login page same as mypassword.

Tried isset but still won't get the right output.
And i'm entering the correct records from my DB.

abelingaw 69 Posting Whiz in Training

Solved, thanks rotten and all who replied..

abelingaw 69 Posting Whiz in Training

It returns this error:

Access denied for user ''@'localhost' to database 'students'
abelingaw 69 Posting Whiz in Training

Change DB name but still get the same output..

Even checked privileges and their all fine. But still.

abelingaw 69 Posting Whiz in Training

Thanks, finally got it.

<td colspan='2'  align="center">
				
 <!--- CAPTCHA SECTION --->
	<img src="captcha.php">
					
</td>

Thanks guys.

abelingaw 69 Posting Whiz in Training

Cannot Find Database

So i should change my db name then? or something else is wrong.

abelingaw 69 Posting Whiz in Training

I can't figure out what is wrong since my codes are correct.

$host="localhost";
$username="";
$password="";
$db_name="database";
$tbl_name="members";


mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("Cannot Find Database");

Keeps on saying the die statement.

I'm using WAMP, and yes. my database name is "database" and table is name is "member".
Or is my db name is a reserve word.

abelingaw 69 Posting Whiz in Training

I have tried editing the captcha file. but still wont get centered.. Running out of ideas here.

abelingaw 69 Posting Whiz in Training

Done, but still the same. Or should i edit it on the captcha php file?

abelingaw 69 Posting Whiz in Training

Hi there.

I'm having some problem in aligning my captcha image on a form.

Here's the SS:

http://imageshack.us/photo/my-images/33/captchab.jpg

And here's my login code:

<html>
<title>Log In</title>
<style>
.singleBorder{
    border:1px #d6d6d6 solid;
    background-color:#f6f6f6;
}
.singleBorder td{
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:12px;
    font-weight:bold;
    color:#333333;
}
.singleBorder input,select{
    border:1px #aaaacc solid;
    font-family:tahoma;
    font-size:12px;
    font-weight:normal;
    padding:2px;
    background-color:#FFFFFF;
}
.singleBorder input:focus{  /* doesn't work in IE 5,6 */
    border:1px #aaaacc solid;
    font-family:tahoma;
    font-size:12px;
    font-weight:normal;
    padding:2px;
    background-color:#FFFF99;
}
.points{
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:12px;
    color:#999999;
    font-weight:normal;
    padding:30px;
}
.formHeading{
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:22px;
    font-weight:bold;
    color:#0066CC;
    padding:10px;
    text-shadow:#FF3333 .2em .2em .2em; 
}

</style>
</head>
<body>
<div id="contentWrapper">
    <table width="550px" border="0" cellpadding="2px" cellspacing="1px" align="center">
        <tr>
            <td width="2px"></td>
            <td>
                <div class="formHeading" align="center">Login Form</div>
                <table width="100%" border="0" cellpadding="3px" class="singleBorder" cellspacing="2">
                    <tr>
                        <td colspan="2">
                            <table width="100%">
                                <tr>
                                    <td>
                <div class="points" align="center">
                    <p style="font-weight:bold; color:#333333">
                    Please login first to continue using our service
                    </p>
                </div>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td align="right" width="130px">
                             Username:
                        </td>
                        <td><input type="text" size="40" /></td>
                    </tr>
                    <tr>
                        <td align="right">
                            Password:
                        </td>
                        <td><input type="text" size="40" /></td>	
                    </tr>
					<br><br>
					

                    <tr>
					<td>
				
				<!----- CAPTCHA SECTION ------>
					<img src="captcha.php">
					</td>
					<tr>
                        <td align="right">
                         Verification Code:
                        </td>
                        <td><input type="text" size="40" /></td>
                    </tr>
                    <tr>
                       
                    <td></td>
                    </tr>
					
					<tr>
                    <td></td>
                    <td height="40">
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="submit" name="Submit2" value="Log In">&nbsp;&nbsp;
                        <input value="Reset" class="btnbg" type="reset" action="login.php">&nbsp;&nbsp;&nbsp;
						<input value="Home"  type="submit" action="index.php">
						
				   </td>
                </tr>
					
                    
                      					
                        </td>
                   
                </table>
			<td>
            </td>
        </tr>
    </table>
	<br><br>


	
</body>
</html>

Tried putting center tag but doesn't work. Any idea?

abelingaw 69 Posting Whiz in Training

Fix the file permissions..

Can u give me a sample code of the correct including path..

abelingaw 69 Posting Whiz in Training

I just uploaded my php files on my webhost, and begi editing the links in my index.php.

And when I tried viewing my site, i receive the following errors.

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/a4478641/public_html/index.php on line 3

Warning: include(http://abelingaw.site90.com/phavi/common.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/a4478641/public_html/index.php on line 3

You can view my site HERE

abelingaw 69 Posting Whiz in Training

You might wanna use some ocx files to create such interface..

And i think its really hard just to use VB6 for that without using any other resources..