Jump to content

chris_rulez001

Members
  • Posts

    220
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

chris_rulez001's Achievements

Member

Member (2/5)

0

Reputation

  1. hey, can someone help me please? it says i have a error in my insert into query. error: Syntax error in INSERT INTO statement. query: INSERT INTO web_action_log (web_address, time_and_date, user, action) VALUES ('" & Address_Bar.Text & "','" & mytime & "','" & Environ("username") & "', 'Web page access blocked') i honestly dont see anything wrong with that query.
  2. Hey, ive made this code and i have an error, it says: 'ExecuteScalarQuery' is not a member of 'Oledb.OledbCommand' code: Imports System.Data.OleDb Imports System.Data Public Class Form2 Dim result As String Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Timer1.Start() Dim q1 As OleDb.OleDbCommand q1 = New OleDb.OleDbCommand("SELECT uniquestaffid FROM (staff) WHERE (username=`" & Form1.TextBox1.Text & "`)", New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=staff.mdb;User Id=Admin;Password=;")) MsgBox(q1.ExecuteScalarQuery.ToString()) End Sub Private Sub errormsg() Timer1.Stop() result = MsgBox("Unable to book you on, please try again" & vbNewLine & vbNewLine & "Would you like to try again", vbYesNo, "Error") If result = MsgBoxResult.No Then Me.Hide() Form1.Show() Form1.TextBox1.Clear() Form1.TextBox2.Clear() Form1.DomainUpDown1.Text = "SELECT" Else Me.Hide() Form1.Show() Form1.TextBox1.Clear() Form1.TextBox2.Clear() Form1.DomainUpDown1.Text = "SELECT" End If End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim random As New Random Dim q1 As OleDb.OleDbCommand Dim sConnectionString As String sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=`staff.mdb`;User Id=;Password=;" If ProgressBar1.Value = ProgressBar1.Maximum Then Timer1.Stop() Me.Hide() Form1.Show() Form1.TextBox1.Clear() Form1.TextBox2.Clear() Form1.DomainUpDown1.Text = "SELECT" Else ProgressBar1.Value += random.Next(1, 2) If ProgressBar1.Value = 88 Then Timer1.Stop() q1 = New OleDb.OleDbCommand("SELECT uniquestaffid FROM (staff) WHERE (username=`" & Form1.TextBox1.Text & "`)", New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=`staff.mdb`;User Id=;Password=;")) Dim conn As New System.Data.OleDb.OleDbConnection(sConnectionString) conn.Open() If Form1.TextBox2.Text <> q1.ToString() Then errormsg() Else MsgBox("Successfully booked on", MsgBoxStyle.Information) Me.Hide() Form1.Show() Form1.TextBox1.Clear() Form1.TextBox2.Clear() Form1.DomainUpDown1.Text = "SELECT" End If End If End If End Sub End Class any help please?
  3. Hey, im going to be making a chat section for my game, any ideas on how to do this? i am familar with tcp and asking tcp to connect to 192.168.1.2, but how would i make external pcs out of my network connect to my pc?
  4. ive fixed it now, ive changed my code heres the working code: Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim random As New Random Timer1.Interval = random.Next(100, 1000) If ProgressBar1.Value = ProgressBar1.Maximum Then Timer1.Stop() Me.Hide() Form1.Show() Else ProgressBar1.Value += random.Next(1, 3) If ProgressBar1.Value = 4 Then Label1.Text = "Initializing Game Route" ElseIf ProgressBar1.Value = 45 Then Label1.Text = "Initializing Graphics" ElseIf ProgressBar1.Value = 60 Then Label1.Text = "Initializing Controls" ElseIf ProgressBar1.Value = 88 Then Label1.Text = "Initalizing Game" End If End If End Sub for people using this code, the bits in red can be changed or removed
  5. hey im having trouble with a vb progressbar. code: Public Class Form2 Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Label1.Text = "" Timer1.Enabled = True Timer1.Start() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick If ProgressBar1.Value = ProgressBar1.Minimum Then ProgressBar1.Value = 1 ProgressBar1.Value = ProgressBar1.Value + 1 Label1.Text = "Initializing Game Route" End If If ProgressBar1.Value = 45 Then Label1.Text = "Initializing Graphics" End If If ProgressBar1.Value = 60 Then Label1.Text = "Initializing Controls" End If If ProgressBar1.Value = 88 Then Label1.Text = "Initalizing Game" End If If ProgressBar1.Value >= ProgressBar1.Maximum Then Timer1.Stop() Me.Hide() Form1.Show() End If End Sub End Class all its doing is putting progressbar1's value as 2. can someone help please? i am confused ???
  6. ok ill look into it and see what i find, thank you for your help
  7. Hi, im making a project in visual basic, i am making a order form for items. all i want is to type the catologue number in 1 textbox and then it display the name of the item in another textbox. Code: Imports System.Data.OleDb Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load TextBox2.Enabled = False End Sub Private Sub CheckBox1_Checked(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged If CheckBox1.Checked Then TextBox2.Enabled = True End If End Sub Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged Dim ConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=../../../../../Shop.mdb;User Id=;Password=;" Dim oConn As New OleDbConnection(ConnStr) oConn.Open() Dim r1, r2 As OleDb.OleDbCommand r1 = New OleDb.OleDbCommand("SELECT Catologue Number FROM Stock WHERE Catologue Number = '" & TextBox1.Text & "'", oConn) r2 = New OleDb.OleDbCommand("SELECT Name FROM Stock WHERE Catologue Number = '" & TextBox1.Text & "'", oConn).ToString If r1.ExecuteScalar.ToString <> TextBox1.Text Then Else TextBox3.Text = r2.ExecuteScalar.ToString End If oConn.Close() End Sub End Class Error: "Syntax error (missing operator) in query expression 'Catologue Number'." can anyone help? im sooo confused ???
  8. i have found something out. this code works fine uploads all files but i would like to restrict all files exept 3gp and mp4 files: <?php $action = $_GET['action']; switch($action) { default: if(!isset($_SESSION['username']) == false) { echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"?action=upload\"> <input type=\"file\" name=\"fileToUpload\" /><br /> <input type=\"submit\" value=\"Upload File\" /> </form><br/><br/>Maximum Video Size: 3 MB (3,000 KB)"; } else { echo "<table width=\"400\" border=\"1\"> <tr> <td align=\"center\">Access Denied</td> </tr> <tr> <td align=\"center\">You are not allowed to view this page.</td> </tr> </table>"; } break; case upload: if (($_FILES["fileToUpload"]["type"] == "video/mpeg4") || ($_FILES["fileToUpload"]["type"] == "video/3gpp") && ($_FILES["fileToUpload"]["size"] < 3000)) { echo "Files must be either 3PG or MP4 and less than 3,000 KB (3 MB)<br/><br/><a href=\"javascript:history.go(-1)\">Go Back</a>"; } else { move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], "uservideos/" . $_FILES["fileToUpload"]["name"]); echo "<table border=\"1\">"; echo "<tr><td>Client Filename: </td> <td>" . $_FILES["fileToUpload"]["name"] . "</td></tr>"; echo "<tr><td>File Type: </td> <td>" . $_FILES["fileToUpload"]["type"] . "</td></tr>"; echo "<tr><td>File Size: </td> <td>" . ($_FILES["fileToUpload"]["size"] / 1024) . " Kb</td></tr>"; echo "<tr><td>Name of Temporary File: </td> <td>" . $_FILES["fileToUpload"]["tmp_name"] . "</td></tr>"; echo "</table>"; echo "<br/>File Successfully Uploaded.<br/><br/><a href=\"upload.php\">Upload More Videos</a> Or <a href=\"index.php\">Return To Homepage</a>"; } break; } ?>
  9. EDIT: nevermind, im just finding the 3 digit value the 3 digit value is 755
  10. EDIT: nevermind, im just finding the 3 digit value
  11. Files must be either 3PG or MP4 and less than 3,000 KB (3 MB) thats my error message
  12. im running my site on localhost and i cant ftp localhost
  13. hi whats wrong with this php file upload code: <?php $action = $_GET['action']; switch($action) { default: if(!isset($_SESSION['username']) == false) { echo "<form enctype=\"multipart/form-data\" method=\"post\" action=\"?action=upload\"> <input type=\"file\" name=\"fileToUpload\" /><br /> <input type=\"submit\" value=\"Upload File\" /> </form><br/><br/>Maximum Video Size: 3 MB (3,000 KB)"; } else { echo "<table width=\"400\" border=\"1\"> <tr> <td align=\"center\">Access Denied</td> </tr> <tr> <td align=\"center\">You are not allowed to view this page.</td> </tr> </table>"; } break; case upload: if (($_FILES["fileToUpload"]["type"] == "movie/mpeg4") || ($_FILES["fileToUpload"]["type"] == "movie/3gpp") && ($_FILES["fileToUpload"]["size"] < 3000)) { move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], "uservideos/" . $_FILES["fileToUpload"]["name"]); echo "<table border=\"1\">"; echo "<tr><td>Client Filename: </td> <td>" . $_FILES["fileToUpload"]["name"] . "</td></tr>"; echo "<tr><td>File Type: </td> <td>" . $_FILES["fileToUpload"]["type"] . "</td></tr>"; echo "<tr><td>File Size: </td> <td>" . ($_FILES["fileToUpload"]["size"] / 1024) . " Kb</td></tr>"; echo "<tr><td>Name of Temporary File: </td> <td>" . $_FILES["fileToUpload"]["tmp_name"] . "</td></tr>"; echo "</table>"; echo "File Successfully Uploaded"; } else { echo "Files must be either 3PG or MP4 and less than 3,000 KB (3 MB)<br/><br/><a href=\"javascript:history.go(-1)\">Go Back</a>"; } break; } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.