SEARCH YOUR SOLUTION HERE  

Asp/Sql code help

hello again, i started this thread last week but wasn't able to finish.
i am trying to do a simple sql statement in asp (dreamweaver) and
due to my in experience in coding i am having lots of trouble but
below i am gonig to post the code and if anyone could be so kind as to lend a hand
i would be much appreciated...thanks




Car List








Posted On: Friday 26th of October 2012 04:31:12 AM Total Views:  438
View Complete with Replies




Related Messages:

Image uploading help   (702 Views)
hi, need some help in this issue i have used this code earlier and it works fine its giving an error for the first time here is what i do i get some data and images from html page and then upload the images in sql server the format in table is image so i store the image directly in the table and the corresponding data so what i used to do earlier is have a loader.asp file included into my asp page here is the code for the confirm.asp page Code: and here is the code for the loader.asp page which i have included in the confirm.asp page Code: 0 Then Dim binData binData = Request.BinaryRead(Request.TotalBytes) getData binData End If End Sub Public Function getFileData(name) If dict.Exists(name) Then getFileData = dict(name).Item("Value") Else getFileData = "" End If End Function Public Function getValue(name) Dim gv If dict.Exists(name) Then gv = CStr(dict(name).Item("Value")) gv = Left(gv,Len(gv)-2) getValue = gv Else getValue = "" End If End Function Public Function saveToFile(name, path) If dict.Exists(name) Then Dim temp temp = dict(name).Item("Value") Dim fso Set fso = Server.CreateObject("Scripting.FileSystemObject") Dim file Set file = fso.CreateTextFile(path) For tPoint = 1 to LenB(temp) file.Write Chr(AscB(MidB(temp,tPoint,1))) Next file.Close saveToFile = True Else saveToFile = False End If End Function Public Function getFileName(name) If dict.Exists(name) Then Dim temp, tempPos temp = dict(name).Item("FileName") tempPos = 1 + InStrRev(temp, "\") getFileName = Mid(temp, tempPos) Else getFileName = "" End If End Function Public Function getFilePath(name) If dict.Exists(name) Then Dim temp, tempPos temp = dict(name).Item("FileName") tempPos = InStrRev(temp, "\") getFilePath = Mid(temp, 1, tempPos) Else getFilePath = "" End If End Function Public Function getFilePathComplete(name) If dict.Exists(name) Then getFilePathComplete = dict(name).Item("FileName") Else getFilePathComplete = "" End If End Function Public Function getFileSize(name) If dict.Exists(name) Then getFileSize = LenB(dict(name).Item("Value")) Else getFileSize = 0 End If End Function Public Function getFileSizeTranslated(name) If dict.Exists(name) Then temp = LenB(dict(name).Item("Value")) If temp 0 inStrByte = InStrB(currentPos, rawData, separator) mValue = inStrByte - currentPos If mValue > 1 Then value = MidB(rawData, currentPos, mValue) Dim begPos, endPos, midValue, nValue Dim intDict Set intDict = Server.CreateObject("Scripting.Dictionary") begPos = 1 + InStrB(1, value, ChrB(34)) endPos = InStrB(begPos + 1, value, ChrB(34)) nValue = endPos Dim nameN nameN = MidB(value, begPos, endPos - begPos) Dim nameValue, isValid isValid = True If InStrB(1, value, stringToByte("Content-Type")) > 1 Then begPos = 1 + InStrB(endPos + 1, value, ChrB(34)) endPos = InStrB(begPos + 1, value, ChrB(34)) If endPos = 0 Then endPos = begPos + 1 isValid = False End If midValue = MidB(value, begPos, endPos - begPos) intDict.Add "FileName", trim(byteToString(midValue)) begPos = 14 + InStrB(endPos + 1, value, stringToByte("Content-Type:")) endPos = InStrB(begPos, value, ChrB(13)) midValue = MidB(value, begPos, endPos - begPos) intDict.Add "ContentType", trim(byteToString(midValue)) begPos = endPos + 4 endPos = LenB(value) nameValue = MidB(value, begPos, ((endPos - begPos) - 1)) Else nameValue = trim(byteToString(MidB(value, nValue + 5))) End If If isValid = True Then intDict.Add "Value", nameValue intDict.Add "Name", nameN dict.Add byteToString(nameN), intDict End If End If currentPos = lenSeparator + inStrByte Wend End Sub End Class Private Function stringToByte(toConv) Dim tempChar For i = 1 to Len(toConv) tempChar = Mid(toConv, i, 1) stringToByte = stringToByte & chrB(AscB(tempChar)) Next End Function Private Function byteToString(toConv) For i = 1 to LenB(toConv) byteToString = byteToString & Chr(AscB(MidB(toConv,i,1))) Next End Function %> its throwing an error in loader.asp page like this Microsoft VBScript runtime error '800a0005' Invalid procedure call or argument: 'MidB' /store/mainwebsite/Loader.asp, line 134 and line 134 is this one separator = MidB(rawData, 1, InstrB(1, rawData, ChrB(13)) - 1) can someone tell me whats it related with i am uploading 3 images at one time
Sorting Recordsets - help needed please   (363 Views)
I have never sorted a recordset - using rs.Sort - i have no problem sorting it in SQL. the tutorials i get say that i have to use a client cursor location, so this is my code: ----------------- Dim cnn set cnn = Server.Createobject("ADODB.Connection") Dim rst set rst = Server.Createobject("ADODB.Recordset") cnn.Provider="Microsoft.Jet.OLEDB.4.0" cnn.Open(Server.Mappath("northwind.mdb")) rst.CursorLocation = adUseClient -------------------- and this is the error: ------------------------ ADODB.Recordseterror '800a0bb9' Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. /sort/test3.asp, line 13 ------------------- Does anyone have a versy basic example of sorting recordsets on a page. What i want to do is return a table with 4 columns and allow the user to click on the name of the column and the page refreshes with the table sorted by that column. Would it be better to just pass the value of the sort and reload the page and query the DB everytime someone wants to order the table
online store +mdb connection help   (420 Views)
Hi My friend has asked me to take a look at a problem with his asp online store. I am a web designer but have only a little asp and microsoft databse knowledge so your help is much appreciated. Firstly, the store functions correctly apart from a problem within the admin area. The admin area allows the manager to make changes to products and sections. Products can be added to the store throught he admin area and will appear on line no problem. The issue lies within the product_list.asp page. This page has been designed to allow products to be edited. There are 600 products listed in a microsoft access database. The product_list page displays a pull down list of all 600 products and a detailed description of the first 25 with edit buttons for each. This page is shown as: https://mysite.co.uk/mine/admin/product_list.asp When the next button is selected to show the next 25 products the page shows: https://mysite.co.uk/mine/admin/prod....aspoffset=25 But the products on the page aren't actually updated from the database. The page still shows the first 25 products. Also, if I wish to select a single product for editing from the pull down list. The page would show say: https://mysite.co.uk/mine/admin/452 This means product 452 from the database should be displayed but the page returns 'the page cannot be displayed' Any advice or help would be much apprecited to resolve this problem. regards bub
Need help sorting document types   (378 Views)
I'm currently using a document upload script and saving the filename to a database field as such: Code: RS("Title") = Form("SourceFile").FileName What I'm trying to do is evaluate that files type (ie. doc, xls, txt...) and fill in another database field with just the document type or a variable representing it. Is there a way to just strip off the last three letters of the form input and save that seperately
help needed to filter duplicated records - Page 2   (340 Views)
hi, he needs some rep points please click on the scales
append from form to form help   (390 Views)
I am trying to take data from one form that I have set up an append query from and open another form with some of the data prepopulated from the last. I have set up the following to launch the form, however, the filter is not recognising itself and I do not know how to launch the query "qry_appendwme" and populate the new form as quite a newbie. Private Sub chkwme_AfterUpdate() Me.Refresh DoCmd.OpenForm "frmWME", acViewNormal, , "[ID]=forms!frmLeadData!txtID" End Sub
sub procedure help   (255 Views)
I'd like to write an ASP routine that builds a table and is called when a button is clicked (not a submit button). Is there a way to do this Everytime the button is clicked, I want to call the procedure so another table is built. Dynamically building a new table. This is the table that I want to build using the sub procedure: Code: Reviewer Date Comment
A little help...   (402 Views)
I have some ASP code that creates a listbox and lists the correct fieldnames from my access database. What I want to do is display the corresponding record from the fieldname selected on the listbox. Can anyone lead me into the right direction I've searched the forums here and through google... and haven't seen anything remotely similar to what I'm looking for.
Annoying problem. Please any help would be good!! - Page 2   (455 Views)
When using Access you need to wrap date fields in # ... # rather than ' ... ' and you also need to remove the extraneous ): Code: sqlString = sqlString & "FROM Booking WHERE book_week_com = #" & Request.QueryString( "qryCategory" ) & "#)"
Need help wth a loop??   (237 Views)
lo , Can someone help me out with adding a do while not eof loop or somethng similar to this bit of code below please, it works but only if there is one record if more than one obviously it leaves the second in the database! Code: Set Con = Server.CreateObject("ADODB.Connection") Con.Open "****-storeDB" Set RS = Server.CreateObject("ADODB.Recordset") sqlString = "SELECT * FROM cart WHERE trans_id = '" & trans_id & "';" RS.ActiveConnection = Con RS.locktype = adlockOptimistic RS.Open sqlString RS.Delete RS.Update RS.Close
Please help   (274 Views)
hi i m declare one variable and it hold the name of a person eg: strName = "Arvind Singh" and i want to put first four character in an other variable please tell me the way to do this
Global.asa/Session/App/Variables help pls..   (264 Views)
Hi all... I'm trying to add a "user-verifacation" thingy to my site. my problem is using/accessing session variables. all the tutorials say that the global.asa should only have the script tags ( & ) and inside the script itself only have the application/session onstart/end. I've created this global.asa file and put it in my site-root folder: Code: function Session_OnStart() { Session("LoggedIn") = "NO" } but i can't access the session variable Session("LoggedIn")... from any page. what am i doing worng
help with 0x800A0046 error - URGENT PLEASE   (417 Views)
Hi i'm doing an asp page and when i do Set BaanObj = CreateObject("Baan4.Application") i get 0x800A0046 permission denied error my IUSR account has the following priviledges: modify, read and execute,read, write and list the content of all folders... so what can be the problem please help me...i'm desperating best regards and
Global.asa file help   (234 Views)
I am in much need of some help with my global.asa file. I use ASP and mySQL. In a nutshell, When a registered user logs in, a field in I have a field that gets updated in my DB Table. It is a TINYINT. When they log in, it updates the value to 1, when they log out, it updates it to 0. I use a tiny iFrame to create a loop displaying users with the value of 1. Basically a cheasy "Who's Online" function. How ever I am now trying to create a global.asa file to say when the session times out, I want the global file to just update the value back to 0. I am also attempting it so that if the users browser window closes and then gets reopened PRIOR to the timeout limit, It knows they are still logged in. I can provide my script if anyone thinks they can help. !!!!!!!!!!!!!!!!!!! I think my final thought would be that when the user closes their browser, that the session ends and the DB field gets updated from a 1 to a 0. Thank you!!!!!!!!!!!!!! A newbie
CDO.Message.1 error '80040212' , on windows 2003 Please help   (532 Views)
Hi , I am getting this CDO error CDO.Message.1error '80040212' The transport lost its connection to the server. This error is only sometimes times. After doing all the trail & error to duplicate the error , I found out that I am getting this error when the email size is more than 5KB. Here is my code Code: Dim objNewMail Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration") set objNewMail = Server.CreateObject("CDO.Message") objCDOSYSCon.Fields( "http://schemas.microsoft.com/cdo/configuration/smtpserver" ) = "My.IP.ADDR" 'objCDOSYSCon.Fields( "http://schemas.microsoft.com/cdo/configuration/smtpserverport" ) = 25 objCDOSYSCon.Fields( "http://schemas.microsoft.com/cdo/configuration/sendusing" ) = 2 objCDOSYSCon.Fields( "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout" ) = 60 objCDOSYSCon.Fields.Update 'Update the CDOSYS Configuration Set objNewMail.Configuration = objCDOSYSCon objNewMail.From = fromemail objNewMail.To = toemail objNewMail.Bcc = bccemail objNewMail.Subject = subject objNewMail.HTMLBody=emlhead&emlbdy &emlfooter objNewMail.Send Set objNewMail = Nothing I even changed the SMTP Properties --> Message Size to 2048 kb, but I dont understand why this error is coming. Is there any other settings I have change, And also if I use objNewMail.CreateMHTMLBody "bodyfile.asp" this wroks no matter how big the email size is. Please somebody help.
Digits help when calculating...   (289 Views)
Hi all, I have the problem when I calculate a Digits for example: 101.12 * 1.21 the resilt is 122.3552 This one should be 122.36 and if it is 122.3549 to be 122.35 How can I make this thing works....
validation help   (377 Views)
hi, i have a textbox that has a value $6.00 for example the user has to enter a dollar value which has to be less then $6.00 so for example if the user enters 4.00 an alert should be fired telling him he has forgotten his dollar sign ("$") then when he enters it properly like this $5.00 i have to check the value is less then $6.00 and it has to be done in javascript the textbox which holds the $6.00 value is called saleprice the textbox which holds the $5.00 or value less then $6.00 is called userprice can anyone help me in this
help   (205 Views)
hello, beginner here. Anybody knowing where i am going wrong just get the error message: Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. Code:
sql problem, help!!   (330 Views)
I have a table with one column having values stored as a string. example column : subjectCode values : A4, TM4, ASE4, TMA4 I have a page where the user can select one subjectCode by a radiobutton. I then want to display all the records that are associated with that subjectCode. I can't seem to use the LIKE clause because some records in the table may only have one subjectCode where others have a string of values like in the example above. Say for example I want to display all projects that are associated subjectCode "TMA4" it only displays records that start with TMA4 and not the one above, but if I search for records that have any occurence of the subjectCode then when I search for all records that are associated with A4 then I also get records with TMA4 because this has "A4" at the end. any ideas please cheers Brad
ASP Javascript help urgent   (391 Views)
i am getting real frustrated with this issue i have a window open event so when the user clicks on the words he sees a window with a image what i am trying to do is put our company logo at the bottom of the window and its not letting me do it here is the code for it Code: View Large Image so when the user clicks on the View large image he sees this page and the code is like this Code: so where i have put the line Hi for debugging i wanted the company logo to be there but its not displaying the logo so i put a response.write and its not working can anyone tell me how i do it