|
Hi all
I have a problem with reading arabic data from an Access 2000 DB File in asp 3.0
the problem takes two forms:
1) when I add some Arabic data to the access file and upload it to the server,,I get some rubish when I read the data using ASP 3.0 on the server .. while I can read it when using localhost.
2)When I add data in arabic to the database using an ASP form I can read it again using ASP and works fine .. but when I downlaod the file and open it in Access or asp in localhost I see some rubish again..
please me help finding a solution..And send your questions if you find my post unclear..
|
|
|
|
|
I've been trying to do a trivial page to retrieve names from an Access DB, allow a user to select one, then edit it, and save it back to the DB. Simple, right? But I can't find a single example of how to do this on the web, on CP, or in any books I've read. Many examples exist that show how to read from a DB, and a few exist that give a huge array of complex operations I don't need and don't understand, but no resources show how to accomplish a simple select and update operation. Every time I use a form, it seems I have to create yet another page for it to deal with the response, including re-opening the connection and reconstructing the recordset, and leaving the ones created by previous pages in limbo. I know it isn't this hard to do, but I can't seem to get off first base on this project. What's the right way to do this?
"Please don't put cigarette butts in the urinal. It makes them soggy and hard to light" - Sign in a Bullhead City, AZ Restroom
|
|
|
|
|
I assume that is a PHP/ASP page...
Roger Wright wrote:
it seems I have to create yet another page for it
Not necessary... u can make the page itself to handle the form.. by just testing some form fields..
Roger Wright wrote:
re-opening the connection and reconstructing the recordset
I think this is a must when it comes to the db.
Roger Wright wrote:
the ones created by previous pages in limbo.
They are made NULL when the page is executed/displayed full
Roger Wright wrote:
What's the right way to do this?
self-post forms will help if you want to avoid the two different page aproach.
I was born intelligent Education ruined me!.
|
|
|
|
|
SPS wrote:
I assume that is a PHP/ASP page...
Nope. VBScript using InterDev. I know I can make the same page handle the form - I just haven't ever seen how to do this, and nothing I've tried works. Every onclick event I assign a script function to fails, so the only way to make anything happen is to use a submit button on the form. Once that happens, it's too late to properly close out the connection and recordset objects. I know that it supposed to be automatic, but every guideline I read says this is a bad practice and very unreliable. Theoretically I should be able to stick these objects in the Session part of global.asa and have them persist throughout a session, but it has never worked. Besides that, again every guide I've seen strongly recommends not using session objects because of serious performance and reliability problems. That's a moot point, though, since it hasn't worked at all for me - how can it get more unreliable?
"Please don't put cigarette butts in the urinal. It makes them soggy and hard to light" - Sign in a Bullhead City, AZ Restroom
|
|
|
|
|
Not sure where to begin.... It sounds as if you are trying to simply create a web page (*.asp ) using VBScript? If so you can do everything on that one page (again to keep things simple). As soon as you postback to the server you will need to perform the processing. This is just a overly simplified example:
<%
dim name, address, city, state, zip_code
name = Request.Form("name")
address = Request.Form("address")
city = Request.Form("city")
state = Request.Form("state")
zip_code = Request.Form("zip_code")
dim adors, conn, sql
set conn = Server.CreateObject("ADODB.Connection")
set adors = Server.CreateObject("ADODB.Recordset")
conn.ConnectionString = "[YourConnectionStringToDbHere]"
conn.Open
adors.ActiveConnection = conn
sql = "Select * from DataTable Where name = '" & name & "' and
address = '" & address & "' and city = '" & city & "' and
state = '" & state & "' and zip_code = " & zip_code
adors.Open(sql)
if not adors.eof
do until adors.eof
Response.Write "Name: " & adors("name") & "<br>"
Response.Write "Address: " & adors("address") & "<br>"
Response.Write "City: " & adors("city") & "<br>"
Response.Write "State: " & adors("state") & "<br>"
Response.Write "Zip Code: " & adors("zip_code") & "<br>
Response.Write "<hr>
adors.MoveNext
loop
adors.Close
conn.Close
set adors = nothing
set conn = nothing
Response.End
end if
%>
<HTML>
<head>
</head>
<BODY>
<form .....>
All 5 input boxes here....
</form>
</BODY>
</HTML>
Does this help at all? http://www.4guysfromrolla.com/[^] is normally a good site for ASP code examples, unfortunately as I write this the site seems to be down.
-Nick Parker
|
|
|
|
|
That much is easy enough - I had it working months ago. In a bit more detail, I have a small db with 4 tables that I use to populate a website. I'm tired of having to maintain the db myself and want to farm it out to someone who knows nothing about databases or websites by creating a non-public entry point on the site that allows an authorized delegate to select one of the tables, then add, edit, or delete entries. Selecting the table is easy, the login is only a tiny bit harder, displaying the records and selecting one for editing was challenging, but not overwhelming. Updating the db after modifying the selected record is proving to be my undoing. I can do it simply enough by having a separate chain of pages to respond to the forms for each table, but that seems unnecessarily complex, not to mention tacky.
I'd really like to do everything (except the login) from one page, using just one connection, and creating recordsets as needed, then neatly disposing of everything properly before selecting another table or record for editing. I'm using VBS only because I know it better than JScript and don't feel like struggling with language basics while I'm excessively challenged by db problems, but it's incredibly limited! Perhaps it's time (again) to trash everything and start over...
"Please don't put cigarette butts in the urinal. It makes them soggy and hard to light" - Sign in a Bullhead City, AZ Restroom
|
|
|
|
|
Roger Wright wrote:
Perhaps it's time (again) to trash everything and start over...
Roger, take a look at this:
Universal Table Editor[^]
-Nick Parker
|
|
|
|
|
I have, and I'm envious! It's an excellent work, and a huge overkill for what I'm trying to do - solve a simple problem, and learn while I'm at it.
I've got a copy of UTE, though, for reference and learning - outstanding work. Thanks!
"Please don't put cigarette butts in the urinal. It makes them soggy and hard to light" - Sign in a Bullhead City, AZ Restroom
|
|
|
|
|
try 1clickdbfree
it has everything down the earth for database!!
I was born intelligent Education ruined me!.
|
|
|
|
|
|
Davy Mitchell wrote:
Anyone use http://geourl.org[^]?
Just spotted it yesterday. Put the code in my blog page (co'ords for Cape Town, South Africa) but it has not picked up on it yet (my blog software has no republished my template blah blah blah but once it has I will ping.)
Nice idea actually. I especially like it for sites talking on a certain region. Could be quite powerful if more sites start doing it. Show all sites for instance that talk about the Amazon rainforest.
Paul Watson Bluegrass Cape Town, South Africa
Vivek Rajan wrote (about the Matrix):
I assume they are using low colors because they want faster rendering using cheaper hardware... ...Cmon - atleast use 256 colors...
|
|
|
|
|
How to trim a string in JavaScrip? (like Trim function in VBScript)
aTpnT
|
|
|
|
|
Those programmers who work in IT departments of banks know very-well what SWIFT is. My question is, how can one get information about a specific bank programmatically using its SWIFT address (BIC)? In my application I need to get information about a specific bank (its name, address .. etc) by directly retrieving the data from www.swift.com, do you know of any web service that could do this?
(a.k.a. Wal2k) www.wal2k.com
|
|
|
|
|
I must be missing something in the big picture....
Using CodeBehind, how can I dynamically create new controls (in this case, TextBoxes) which I can relocate on the Web Form programatically? I can see how this is possible using Windows Forms (the LEFT and TOP calls are there), but not in a Web Form (I can't seem to find a way to change the location, just WIDTH and HEIGHT). The number (I also can't seem to create controls programatically, either...) and location of text boxes and potentially other controls will vary in my application, depending on the number of db rows retrieved from a user query.
Any help is appreciated! Thanks!
MikeRoad
|
|
|
|
|
I'm going to make a quick assumption ... you are using VS.NET, right?
First off, I would imagine that you want could dynamically make the new controls whenever you needed to make them, for example, on the click event of a button.
However, to position them programmatically you will have to play with their style attributes for this to display correctly in a web browser. First thing is to set the positition to absolute and then you can set the top and left style attributes to set their location on the page. If you are using VS.NET and have the Design Mode of a Web Form open and are using the Grid Layout for the page then you can check the HTML used for the form and see how elements are being positioned on the page that are already set through design mode. Hopefully this will give you some insight.
If you are going to be displaying information back to the users from a DB then I would suggest using the DataGrid because of its amazing flexibility. Check out the many articles on http://4guysfromrolla.com[^] for some great resources on ASP.NET.
Wally Atkins Newport News, VA, USA
|
|
|
|
|
Thanks very much for this. I'll give it a try. I'm travelling in China, so my time sync is... well - isn't. But this gives me what I need to get working.
|
|
|
|
|
I am probably missing some very important concept about CGI programming. I am currently reading about CGI programming with Perl and I am wondering why there was no CGI programming functionalities with the traditional compiled languages such as C++.
Perl CGI scripts are run by web servers to generate web content dynamically and that content is sent back to the requesting browser in the form of an HTML web page. To be more specific these scripts are run by Perl.exe, which is installed on the server.
The CGI.pm module has many functionalities and methods for creating HTML on the fly. OK, if that is the case, how come there is no "CGI library" for C++ that contains those similar functions. For example, if you can "#include<cgi.dll>" or something of that sort in your C++ program, then shouldn't you be able to dynamically create HTML web pages too? Yet, up to now, I havent heard any talk about programming the web with C++. How come C++ was never made to build web pages?
|
|
|
|
|
CGI is just an interface so they can be written in C or C++ or whatever.
Scriptable languages seem to have found favour with web development as they are easy to change on the fly - there is no 'compile' step. You could use C++ but there is little advantage.
Davy
Blog for Software Testing, Bugs, Quality, Security and Stability - www.latedecember.com
News From Scotland - The Angus Blog and The Dundee Blog
My Personal Blog - Homepage.
|
|
|
|
|
One of my assignments back in college was to write a few simple C++ applications that were used as CGI's ... it was kind of a pain in the @$$ but with many hours of tinkering I was able to get it to work.
It was tough to figure out how to read in the querystring and form data but once you find out the basics ... returning strings of HTML to the client is very easy.
Wally Atkins Newport News, VA, USA
|
|
|
|
|
You can wirite CGI programs in any language that supports environment variables and standard console I/O. There are CGI class libraries for C++, e.g. GNU cgicc, CGI++, MV4, etc.
|
|
|
|
|
Yes, and we have even created an Application Server that hosts C++ code (similar to a J2EE server). C++, used in the right way within the right framework actually provides the highest level of performance possible for dynamic content. FYI, you shouldn't use CGI. It is one of the slowest and most resource intensive methods of generating dynamic content.
|
|
|
|
|
Is there a way to put spaces between the list item, say bullete, and the texts? I tried putting some spaces using $nbsp; between the list item and the texts but it only work for the first line. If the line of texts wrap then the wrap part is not align with the above line.
Thanks!
ljCharlie
|
|
|
|
|
You need to set the padding-left style on the <li> element.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Thanks for the help. Is this what you mean:
<li style="padding-left">The situation---opportunity, problem, issue, need---that <br />
your proposal addresses.
I tried this but it doesn't work. What is padding-left mean?
ljCharlie
|
|
|
|
|
You're nearly there - you just need to tell it how much space you want.
Also, don't forget the list tags (<ul> , <ol> , etc.):
- The situation---opportunity, problem, issue, need---that
your proposal addresses. - The situation---opportunity, problem, issue, need---that
your proposal addresses. - The situation---opportunity, problem, issue, need---that
your proposal addresses.
<ul>
<li>The situation---opportunity, problem, issue, need---that <br />
your proposal addresses.</li>
<li style="padding-left:10px;">The situation---opportunity, problem, issue, need---that <br />
your proposal addresses.</li>
<li style="padding-left:20px;">The situation---opportunity, problem, issue, need---that <br />
your proposal addresses.</li>
</ul>
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|