Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. a little help here

a little help here

Scheduled Pinned Locked Moved ASP.NET
databasemysqlsysadminhelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    blitz2bleach
    wrote on last edited by
    #1

    im doing a samle project that i want to include in my project.. here is the sample code... <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> <%@ Import Namespace=System.Web.HttpException %> Northwind Database Login Sub doInsert(Source as Object, E as EventArgs) Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _ Server.MapPath("C:\Documents and Settings\Joy.PHOENIX-1D0486C\Desktop\userId.mdb") & ";" Dim MySQL as string = "Insert into Members (uid, pwd, fullname, email) " & _ "Values (@uid, @pwd, @fullname, @email)" Dim MyConn As New Data.OleDb.OleDbConnection(strConn) Dim Cmd As New Data.OleDb.OleDbCommand(MySQL, MyConn) With Cmd.Parameters .Add(New Data.OleDb.OleDbParameter("@uid", frmuid.Text)) .Add(New Data.OleDb.OleDbParameter("@pwd", frmpwd.Text)) .Add(New Data.OleDb.OleDbParameter("@fullname", frmfullname.Text)) .Add(New Data.OleDb.OleDbParameter("@email", frmemail.Text)) End With MyConn.Open() cmd.ExecuteNonQuery() MyConn.Close 'Put a label on your page to contain the 'success' response: lblMessage.Text = "Thank you for signing up. An email will be sent to you shortly." & _ "Your response will be needed from that email to activate your account" End Sub

    uid

    pwd

    fullname

    email

    G S 2 Replies Last reply
    0
    • B blitz2bleach

      im doing a samle project that i want to include in my project.. here is the sample code... <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> <%@ Import Namespace=System.Web.HttpException %> Northwind Database Login Sub doInsert(Source as Object, E as EventArgs) Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _ Server.MapPath("C:\Documents and Settings\Joy.PHOENIX-1D0486C\Desktop\userId.mdb") & ";" Dim MySQL as string = "Insert into Members (uid, pwd, fullname, email) " & _ "Values (@uid, @pwd, @fullname, @email)" Dim MyConn As New Data.OleDb.OleDbConnection(strConn) Dim Cmd As New Data.OleDb.OleDbCommand(MySQL, MyConn) With Cmd.Parameters .Add(New Data.OleDb.OleDbParameter("@uid", frmuid.Text)) .Add(New Data.OleDb.OleDbParameter("@pwd", frmpwd.Text)) .Add(New Data.OleDb.OleDbParameter("@fullname", frmfullname.Text)) .Add(New Data.OleDb.OleDbParameter("@email", frmemail.Text)) End With MyConn.Open() cmd.ExecuteNonQuery() MyConn.Close 'Put a label on your page to contain the 'success' response: lblMessage.Text = "Thank you for signing up. An email will be sent to you shortly." & _ "Your response will be needed from that email to activate your account" End Sub

      uid

      pwd

      fullname

      email

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      You are using a physical address in the call to Server.MapPath. This is not possible, as Server.MapPath is used to turn a virtual path into a physical path, so it expects a virtual path. Just remove the call to Server.MapPath, as you already have a physical path.

      --- single minded; short sighted; long gone;

      1 Reply Last reply
      0
      • B blitz2bleach

        im doing a samle project that i want to include in my project.. here is the sample code... <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> <%@ Import Namespace=System.Web.HttpException %> Northwind Database Login Sub doInsert(Source as Object, E as EventArgs) Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _ Server.MapPath("C:\Documents and Settings\Joy.PHOENIX-1D0486C\Desktop\userId.mdb") & ";" Dim MySQL as string = "Insert into Members (uid, pwd, fullname, email) " & _ "Values (@uid, @pwd, @fullname, @email)" Dim MyConn As New Data.OleDb.OleDbConnection(strConn) Dim Cmd As New Data.OleDb.OleDbCommand(MySQL, MyConn) With Cmd.Parameters .Add(New Data.OleDb.OleDbParameter("@uid", frmuid.Text)) .Add(New Data.OleDb.OleDbParameter("@pwd", frmpwd.Text)) .Add(New Data.OleDb.OleDbParameter("@fullname", frmfullname.Text)) .Add(New Data.OleDb.OleDbParameter("@email", frmemail.Text)) End With MyConn.Open() cmd.ExecuteNonQuery() MyConn.Close 'Put a label on your page to contain the 'success' response: lblMessage.Text = "Thank you for signing up. An email will be sent to you shortly." & _ "Your response will be needed from that email to activate your account" End Sub

        uid

        pwd

        fullname

        email

        S Offline
        S Offline
        Sam Heller
        wrote on last edited by
        #3

        It looks like some sort of issue with the path to the Access database that you are using. As far as I'm aware the Server.MapPath works on the same file structure as your web pages would. Eg ../database/userId.mdb instead of C:\Documents and Settings\Joy.PHOENIX-1D0486C\Desktop\userId.mdb. So put your database either in the root of your site or in a folder, named database, within the root like I have in my example path.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups