Preferred Connection Method?
Which of the following would be the most preferred connection string method? What is the difference?
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/marketing/ics.mdb")
strConn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/marketing/ics.mdb")
View Replies
ADVERTISEMENT
what is more efficient, opening the database once in the beginning of the page then closing it at the end of the page, or opening the db connection each time you need it.
for example:
i have a page that executes 50 queries. is it better to open the db, execute the queries, then close it, or to open and close the db 50 times?
View Replies
View Related
I 've coded an asp webpage where a user could toggle a boolean value through a checkbox.
When the checkbox was pressed, the page posted the toggle action to itself, a
connection.execute "UPDATE tableName SET fieldName=(Not fieldname) WHERE field_id=1
query was performed and the checkbox, after I had retrieved its new value through a recordset, changed its appearence(state). At first I used an MS Access DB and it worked fine.
After I had switched the hole application to work with MS-SQL, although I changed the above query to Code:
View Replies
View Related
Wondered if anyone could help me out with some simple connection string problems I'm having.
Ive got this on the page so far and it works:
----------------------------------------------
Dim strConnString
set strConnString = server.createobject("adodb.connection")
strConnString.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=c:Inetpubwwwrootdlnforumforumadminwwforum.mdb"
strConnString.open
-----------------------------------------------
But I want to change it to a Server.MapPath method, so I tried the following:
------------------------------------------------
Dim strConnString
set strConnString = server.createobject("adodb.connection")
strConnString.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & Server.MapPath("forum/admin/wwforum.mdb")
strConnString.open
---------------------------------------------------
But now I get the following error:
-------------------------------------------
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4E)
Operation was canceled.
Can anyone help me out?
View Replies
View Related
[This question is directed at Bob Barrows, but perhaps someone else knows an
answer. In any case it is good information for the group.]
I really like Bob's "stored procedure as method of Connection Object"
technique. It is convenient, compact, and concise, and simplifies protection
from SQL injection.
HOWEVER, I cannot figure out a way to pass a null value to an INT parameter
when I use this. Null string parameters are fine. The error reads:
Microsoft OLE DB Provider for SQL Server error '80040e07'
Operand type clash: text is incompatible with int
As you can imagine, "text is incompatible with int" gets my attention. I am
explicitly passing a null (not the string "null"). I am using JScript on the
web server and connecting to SQL Server 2000. An example: Code:
View Replies
View Related
The provider I host my website on gives me three options when it comes to
databases:
1. Microsoft Access
2. MySQL
3. MSSQL
I have used Access in the past, and it is adequate for the minor database
work I plan on doing.
However, I would like to learn some quality skills, just in case a client
wants to hire me to do some database work one day.
Which database would be the best to learn? What are the strengths of one
verses the other? What are their weaknesses? Which one is the simplest to
write code for? Which has the most code examples using Classic ASP?
View Replies
View Related
1.
conn.ConnectionTimeout = 60
conn.Open connString
2.
conn.Open connString
conn.ConnectionTimeout = 60
Do both of them give different?
View Replies
View Related
I have downloaded the DiscIDCalc program from CDDB. I've used it a lot because I've written my own application for my CD collections (keeping track of the track information of each CD, track duration etc). I've already got all my CDs into the application, I'm now just going through each of the disc again just to add in the DiscID information. I do it by running the DiscIDCalc program, generating the DiscID, and then then copying and pasting this DiscID into my application and then save it.
if anyone has successfully generated the DiscID within an asp page?
Now I have to have my browser up and this DiscIDCalc program up. Just want to know if there's a way to incorporate the two together (even if it means I'm not using the DiscIDCalc anymore.). This DiscIDCalc has a documentation for its DiscIDCalcDLL.dll but it's not something that I can CreateObject with, so I'm quite clueless... I don't want to use VB to write APIs for that
View Replies
View Related
I use query string to search for records by using GET method. This method will generate querystring automatically by using the form name. Using search field together with drop down is fine but the problem is when i didn't enter any keyword or left the search field blank it won't display any result.
Unless I put "%" in the search field. How do I make the querystring change to "%" whenever the field is blank so that all records will be displayed.
View Replies
View Related
i am trying top update a field in my sql database but it wont let me??? does anyone know if my syntax is correct?? I have a field called userId in the database and want to replace it with my form request. Code:
View Replies
View Related
Method Not Allowed
The requested method POST is not allowed for the URL /Database/processForm.asp.
Apache/1.3.33 Server at antonyx.freestarthost.com Port 80
i just got this error, however, i have managed to post data into my database on this server b4, why is this error comin up now, could there be a prob with my asp file??
View Replies
View Related
When using ActiveX Combo Boxes, can you use the GetString method to populate the control? I currently am using AddItem, however, it is taking a long time to process. I know that GetString works well to improve the performance. Here is my code while using AddItem:
while not rsClient.EOF
Response.Write chr(9) & "MenuForm.lstClient.additem " & chr(34) & replace(rsClient.Fields("Client Name").value,chr(34),"'") & " [" & trim(rsClient.Fields("Client Number").Value) & "]" & chr(34) & chr(13)
rsClient.MoveNext
View Replies
View Related
Now this is a weird one. I'm having a problem with a system in development. When I post data from a form in IE 5.01 it works fine, but in IE 5.5 it refuses to post the data to the server and in IE 6 it's scatty -- works sometimes but not others. Anyone seen this before?
Edit:
By the way -- this is normal VBS/ASP running on IIS 5 on an NT server
View Replies
View Related
can values of variables be transfered through response.redirect onto the next page
View Replies
View Related
I have a form that ignores my form validation code. My code works if I use the post method of <%=Request.ServerVariables("SCRIPT_NAME")%>.
But, If I post the form to another .asp page, which I prefer, the code doesn't work. Do anyone have any suggestions? Here's my code.
I have a form that ignores my form validation code. My code works if I use the post method of <%=Request.ServerVariables("SCRIPT_NAME")%>. But, If I post the form to another .asp page, which I prefer, the code doesn't work. Do anyone have any suggestions? Code:
View Replies
View Related
I have a service provider that's sends sms messages from clients mobile
phones to my asp page, problem is I don't know how to show the data and they
are not being helpful.
The process is simple as outlined below (instructions from service provider
Example: If you provide this: http://www.yourdomain.com/sms/sms.asp then we
will do a post via a standard HTTP GET as follow:
http://www.yourdomain.com/sms/sms.a...ISO-8859-1&udh=
How do I receive the url with the parameters in the address bar?
View Replies
View Related
I would like to know which method is best in ASP when using/coding for email via a form.
View Replies
View Related
What's the best method to hide, or not show a certain record when doing a pull from a database, as in I am pulling a list with a dozen category's and I don't what to show one of them.
View Replies
View Related
I have a demo.asp page, that can't pass hidden value "mr progrramer" to
itself using POST method. Only "mr" is passed.
I created a second asp file demo1.asp and passed "mr programmer" and whole
string (include space b/w mr and programmer was passed successfully).
The code for demo.asp is:
<%
name = request.Form("name")
response.Write "hello " & request.Form("name")
' if name is empty then store some string with space in it
' problem is the word before space 'mr' is passed, but 'programer' is not
passed
if len(name)=0 then
name = "mr programmer"
end if
%>
Code:
View Replies
View Related
I have a .asp page that uses the post method and it works fine on my computer using iis. But when i put it on the web server (it has windows NT4) it wont work.
I've read that you have to do something to allow the post method on the server.
i know nothing about windows NT4 but can get access to the server. can someone please let me know what i have to do to get this to work?
Just to let you know the post method is for ssending a login and pass to another page that search a database for the record. If there is another way to do this that does not show the variables in the url please let me know. i am also willing to make it so that everything is on the same page so i dont have to pass anything.
View Replies
View Related
Based on what the user selects in a combo box I need to find the value from another column in the same record. This is what I am using:
rsPrice.movefirst
rsPrice.Find "Component='Desktop'"
If (rstPrice.BOF = True) or (rstPrice.EOF = True) Then
response.write("The Price for the Component Not Found")
else
curPrice =rsPrice("Score")
End If
I keep getting an error messages:
Microsoft OLE DB Provider for SQL Server (0x80040E29) Rowset does not support scrolling backward.
View Replies
View Related
I'm looking for a renaming method for folder objects.I have an ASP (JScript) application that I'm creating that acts as a document library. Users can upload files, create folders, etc.
Most places I go to basically have: copy, delete, move, create textfile as the only methods for the folder object - NOTHING about renaming.
View Replies
View Related
The Folowing code is not working anymore.(500 error)
Set objRS = strSQL1.Execute
strSQL1 = "SELECT * FROM BannerRotor where BannerID=" & cstr(BannerID)
objRS.Open strSQL1, objConn , 2 , 3 , adCmdText
If not (objRS.BOF and objRS.EOF) Then
[ objRS.Fields("Exposures").Value =objRS.Fields("Exposures").Value + 1
objRS.update
End If
objRS.Close
The .execute Method works fine
strSQL1 = "UPDATE BannerRotor SET Exposures=Exposures+1 WHERE BannerID=" & cstr(BannerID)
objConn.Execute strSQL1
W2003 + IIS6.0
View Replies
View Related
i have a search page script which consists of a text field and a pulldown menu. the search function using search text works but not the pulldown menu. do I have to set separate recordset for each of the search functions, one for the search using text field and another using pulldown menu?
View Replies
View Related
can i gain the two result. in an asp page which using a stored procedure with execute method.
i want to execute the query and return the count value the query at the same time. is it possible and how?must i use ado? it is not possible to make it with execute method in asp.
View Replies
View Related
I am coping a file from server to local on my computer using:
fso.CopyFile Server.MapPath("downloadworkfile.htm"), Server.MapPath("p:workingworkfile.htm"), true
I am getting MapPath method must be a virtual path. How do I reference a virtual path?
View Replies
View Related
Is there a limit to how many variables you can pass on using post method?
View Replies
View Related
When querying a database, I know I can fix the no. of returned rows/results to 20 (for example) using the GetString method:
myVar = objRs.GetString(, 20, , ,)
What syntax do I need to use to do the same with the GetRows method:
myVar = objRs.GetRows ?
View Replies
View Related
I can see how this works, but can anyone clarify what purpose the 1, 1 serves?
Code:
strSearchKeywords = replace(strSearchKeywords, ",", "", 1, 1)
View Replies
View Related
when we should use GET method, when we should use POST method? GET method only sends limited amount of data, and it will show the data as part of URL. POST method won't show the data as part of URL, and can send any amount of data.
View Replies
View Related
the maximum size in car that i can send throught get method ?
View Replies
View Related
why the method GetTempName produced rad as the first 3 characters before giving random letters and numbers? It seems pretty pointless.
View Replies
View Related
I use the following to update:
Dim rsEdit1
Set rsEdit1 = Server.CreateObject("ADODB.Recordset")
rsEdit1.ActiveConnection = MM_shop_STRING
rsEdit1.Source = "SELECT * FROM products WHERE pautoid = 12"
rsEdit1.CursorType = 2
rsEdit1.LockType = 3
rsEdit1.Open()
rsEdit1.("authorMemo") = "TEST" *Error message from this line
rsEdit1.update
rsEdit1.Close()
Set rsEdit1 = Nothing
The problem is that I keep getting the following error message :
"Microsoft VBScript compilation (0x800A03F2) Expected identifier"
View Replies
View Related