Jump to content

foxhound187

Members
  • Content Count

    19
  • Joined

  • Last visited

Community Reputation

2 Neutral

About foxhound187

  • Rank
    Newbie
  1. foxhound187

    ASP Issues

    ok, sanitizing the data can wait. I seem to have got the script working so that it reads and inserts the data from the .csv file into the database however I would like to split the data, so when it inserts the data into the database rather than dumping it all in the one column it splits it into seperate columns per comma. I assume its some kind of array, but this is way over my head. Thanks
  2. foxhound187

    ASP Issues

    ok then that is what it is, the data will have single quotes in it. The log contains all the various user input searches. So how do I sanitize the data ? never heard of that before
  3. foxhound187

    ASP Issues

    I'm still getting that error, I have checked the formatting of the query many times and read the tutorial. sql = "INSERT INTO events (INDATE,FNAME,LNAME,EMP,TITLE,ADD,CITY,STATE,PCODE,EMAIL,PHN,OPTN,DIET) VALUES('"&date&"','"&Request.QueryString("givenName")&"','"&Request.QueryString("surname")&"','"&Request.QueryString("Company")&"','"&Request.QueryString("JobTitle")&"','"&Request.QueryString("Address")&"','"&Request.QueryString("City")&"','"&Request.QueryString("TState")&"','"&Request.QueryString("PostCode")&"','"&Re
  4. foxhound187

    ASP Issues

    yeah I fixed it about 5 minutes after posting, then home time. the problem I'm having now is "Number of query values and destination fields are not the same." Obviously because my Select statement has 4 fields and only 1 Value. I need to split the data that's being read by each line into 4 columns so eachcan be put in each column of the database, I assume an array would be needed for this but don't know where to start ? and I've searched far andwide for this on the net, but no information on how to do it in classic ASP.
  5. foxhound187

    ASP Issues

    Ok changed the code once again, got past that error now have a new one. Microsoft JET Database Engine error '80040e14'Syntax error in INSERT INTO statement. **********************************************<%Dim connDim path path="searchlog.mdb" set conn = Server.CreateObject("ADODB.Connection") ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(""&path&"") conn.open ConnStr Function ReadTextFile(strFilePath) Dim objFSO, objFile, strAllFile Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile
  6. Hi there I've made a couple of scripts that are working perfectly in Win7, however problems arise in WinXP.Here is the first script. ** Connect script ** Const TIMEOUT = 3On Error Resume NextSet objShell = CreateObject("WScript.Shell")Set objNetwork = CreateObject("WScript.Network")Set objFSO = CreateObject("Scripting.FileSystemObject")Set CheckDrive = objNetwork.EnumNetworkDrives()'declare variables'strDesktop = objShell.SpecialFolders("Desktop")strPath = "\\SERVER\D"strPath2 = "\\SERVER\E"strDriveLetter = "Z:"strDriveLetter2 = "X:"strProfile = TruestrUser = "*****"strPassword = "*****"Alread
  7. foxhound187

    ASP Issues

    I'm aware that's what the second error means, I changed the path to test if it was at least connecting and it was, because soon as I changed it I got that error. I will try specifying the connection when I create or open the recordset and let you know how I go. How is the query not in a correct format if I can print the query fine, wouldn't it of crashed ?
  8. foxhound187

    ASP Issues

    Alright code has been updated. ** searchcon.asp ** <% path="searchlog.mdb" set conn = Server.CreateObject("ADODB.Connection") ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(""&path&"") conn.open ConnStr %> ** readlog.asp ** <!--#include file="searchcon.asp"--><% Dim FSODim FilepathDim ContentsDim MSAQDim TextStreamDim rs Const Filename = "searchlog.txt" ' file to readConst ForReading = 1, ForWriting = 2, ForAppending = 3Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0 'Create a filesystem object Set FSO = server.createObje
  9. foxhound187

    ASP Issues

    ok now I'm getting aADODB.Recordset error '800a0bb9' Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. /eventscalendar/database/readlog.asp, line 37 MSAQ = MSAQ = "INSERT INTO lgsdatalog ([logdata]) VALUES ([" & Contents & "])" Set rs = Server.CreateObject("ADODB.Recordset")line 37 ----> rs.open MSAQ
  10. seems to be working now, didn't make any changes ???oh well I won't complain.
  11. no good it seems. I've formatted the Mail body so it's a bit easier to follow. Mail.Body = "There has been a request from: " & Request.QueryString("givenName") + " " + Request.QueryString("surname") + VbCrLf _ + " Company: " + Request.QueryString("Company") + VbCrLf _ + " Job Title: " + Request.QueryString("JobTitle") + VbCrLf _ + " Address: " + Request.QueryString("Address") + VbCrLf _ + " City: " + Request.QueryString("City") + VbCrLf _ + " State: " + Request.QueryString(
  12. foxhound187

    ASP Issues

    So it should be, MSAQ = "INSERT INTO lgsdatalog ([logdata]) VALUES ([" & Contents & "]) or MSAQ = "INSERT INTO lgsdatalog ([logdata]) VALUES ([" & Contents "]) ?? Sorry I'm not very good without examples, aspergers.
  13. Hello, I'm having trouble formatting form data, it's picking up and sending everything correctlyhowever, apon arrival everything is blocked together, seem's to be coming in plain text format As you can see the body is one big chunk, if I try split it up the ASP crashes, and if I try declare a Body2 variablefor example, to help split it up, it crashes also. **example**There has been a request from: Daniel Test Company: LGS Job Title: Web developer Address: Test City: Sydney State: NSW PostCode: 2229 Email: dblah@blah.comsuper.com.au Phone: 9123456789 Booking Type: 1 night's twin share accommo
  14. foxhound187

    ASP Issues

    Yeah the MSAQ is changed because I was told the way you execute an access query is differen't to a mySQL queryso how should it be ?
  15. foxhound187

    ASP Issues

    ok that idea has been abandoned, thanks to the higher ups. Instead now will be connecting via a MS Access db, having similar issues. Here is the code searchcon.asp <-- db connection<%Private Function OpenDatabase() Set objDBConnect = Server.CreateObject("ADODB.Connection") objDBConnect.ConnectionTimeout = 6000 objDBConnect.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("searchlog.mdb")" 'Session("ConnectionString") 'Check to see if the connection is open OK OpenDatabase = False If objDBConnect.State = 1 Then nDBConnect = 1
×
×
  • Create New...