|
I have created a drop down menu (keywords) that list all my entries from my database. I also have a text field (newkeyword) and a Add keyword button (addkeyword). All I am trying to do is add the new keyword to the database and update the drop down menu. My code is as follows.
This is the first time I have attempted such a thing and I have simply ported code from Access. This code doesn't work, please help.
Thankyou in advance
|
|
|
|
|
First thing ... there is no DoCmd in ASP. You need to use ADO directly.
A simple sample is shown below
DSN = "Northwind"
userName = "sa"
Password = ""
SQLStatement = "Select * from Authors"
'create an ADO connection object
set objConn = server.CreateObject("ADODB.Connection")
'open database connection
objConn.Open DSN,userName, password
'execute query
objConn.Execute SQLStatement
|
|
|
|
|
Hi James. You can not use an "On Error GoTo ErrHandler" either, you can use either an "On Error Resume Next" statement and an "On Error GoTo 0" to temporarily disable error handling.
To trap for errors use an On Error Resume Next, and then after performing an operation which might cause an error (e.g. an SQL UPDATE query) examine the Err object. When using ADO you can also examine the Errors collection of the open Connection object. Note that the VBA Err object will contain the error number for the first object in the ADO Errors collection if using ADO and a Connection object.
Also note that sometimes the ADO Errors collection may indicate an error with an error number of zero. This MAY NOT be an error, just a warning!!
Here's some code which checks for an error, and if an error occurs redirects to a generic error page (it assumes there is an open Connection object which is in scope):
<%
sub CheckForError()
'checks for error, if present redirects to error.htm page
on error resume next
dim bErr 'boolean, signifying presence of error
'if error number is 0 then this is not an error,just extra info.
' returned via Errors collection
if objConn.Errors.Count <> 0 then
if objConn.Errors(0).Number = 0 then
objConn.Errors.Clear
end if
end if
bErr = false
if Err.number <> 0 then
bErr = true
elseif objConn.Errors.Count <> 0 then
bErr = true
end if
if bErr = true then
objConn.Close
set objConn = nothing
Response.Redirect "MyErrorPage.htm"
end if
end sub
%>
Martin Eising
|
|
|
|
|
I am trying to get the backround color of the search box on my guestbook to become transparent, or to become the same as the .jpg background for the entire page.
Is there a color code # I can use to achieve transparency?
Thanks in advance, Rob
Rob
|
|
|
|
|
You would have to use Style sheets for that or CSS.
|
|
|
|
|
Hi,
I installed AdMentor to make banner administration inside our intranet, configured it to run with the given Access DB, and it worked perfect, up today, when it started to give me the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x30c Thread 0x128 DBC 0x22ef024 Jet'.
/treinare/admentor/include/admentordb.asp, line 44
Could someone point me a solution to this problem?
Thanks in advance
Marcelo Magri
|
|
|
|
|
I am looking for users who would like you have there own website portal based on .net framework. The portal currently uses ASP.NET and SQL Server 2000. Email me and I will Setup A Portal or store for you for free. I am currently accepting as many as my bandwidth can handle.
Meltucker1@hotmail.com
Example portal can be found here…
http://www.ibuyspy.com/portal/DesktopDefault.aspx
|
|
|
|
|
I have installed PWS onto my WINNT Workstation. I am running the internet via the network so I don't have direct access to the internet. Does this explain why when I test PWS with http://127.0.0.1 I get the following error message:
"You are not authorized to view this page
You might not have permission to view this directory or page using the credentials you supplied.
If you believe you should be able to view this directory or page, please try to contact the Web site by using any e-mail address or phone number that may be listed on the http:// home page.
You can click Search to look for information on the Internet.
HTTP Error 403 - Forbidden
Internet Explorer "
I need to be able to test ASP functionality from my workstation is there anyway round this problem?
Any help would be greatly appreciated
|
|
|
|
|
First try doing this in the windows command prompt, run this string:
ping 127.0.0.1
If the following comes up then your system is OK:
Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
And the try these for the final touch only if above is OK!
Options One:
1- Run PWS
2- Click Advance icon on left
3- Select the top most icon: the Home icon on top of the tree
4- Click Properties
5- Select/Check the Read and Scripts options
Option Two:
1- Click advance icon
2- Check the AllowDirectoryBrowsing
3- Test the browser
This should fix it.
Cheers.
|
|
|
|
|
Can anyone give me a simple example of a script which allows visitors on the site to upload file to the remote server. I have been looking all over the net and can't find it.
Any help would be appreciated !
Thanks, in advance,;)
|
|
|
|
|
Hi All,
My problem is about casting between these types.
the scenario is below.
getdocument -> getactiveelement ->
"it's a frame" I need a way of casting this IHTMLElement to IHTMLElement2 or to IHTMLWindow2
/*
IHTMLElement* pa_el;
...get_activeelement(&pa_el);
CComQIPtr<ihtmlelement2,&iid_ihtmlelement2> pa_el2(pa_el);
I have a dispatch here in pa_el2 but it seems as something is wrong because when I call doScroll, I get errors... if I cast to IHTMLWindow2... it simply returns NULL... (myframe == null)
CComQIPtr<ihtmlwindow2,&iid_ihtmlwindow2> myframe(pa_el);
How can I access to a frame object if I have it as an IHTMLElement?
Please Help...
IHTMLElement and IHTMLElement2 and IHTMLWindow2
|
|
|
|
|
Is there a mechanism in window.open so that the popup window opens as a full screen in IE? I've noticed Netscape will open full screen if the parent window is full screen
Thanks!
Chris
"Why are we hiding from the police, Daddy?"
"We use VI, son. They use Emacs."
|
|
|
|
|
I have an ActiveX grid control on one of my web pages that fires events when cells need updating. Is there a way to specify an event handler in JavaScript for these events?
I've found plenty of examples of how to do it using vbscript but nothing for JavaScript. For example in vbscript if you want to add an event handler for an ActiveX object with an id called 'Grid' and an event called 'UpdateCell' then it seems you just create a subroutine called Grid_UpdateCell() on the page containing the object.
Is there a way to do something similar in JavaScript?
Regards
Martin
|
|
|
|
|
i use something like this for an activex treeviewctrl
function CheckChildren(ParentNode)
{
...
}
// event handler that is called when the check state of a node changes
// the handler propagates the new checkstate down the hierarchy
CheckChildren(theNode);
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnclinic/html/scripting04092001.asp
|
|
|
|
|
Hi Everyone,
Does anyone know how to do program a ASP page which shows the status of servers. For example, I would like to know if the server is down or up and going.
Thanks.
Johnny
|
|
|
|
|
I want to write a simple dictionary that can run in IE. The program contain a Box for typing vocabulary that needs searching and a Search Button. What type of database should I use for storing data and which language is used for manipulating data? Can I test the program on my PC?
|
|
|
|
|
How do we include facility of making the page as a bookmark in users browser as can be seen in many sites. This facility is also given in this site at the top of the page with the option
Bookmark this
Joby Cyriac
|
|
|
|
|
|
I have recordset, I must unfold in each refresh the following row of data. I have made recordset and that it unfolds the data to me, but what I need it is that every time moves when I do refresh.
Since I do it?
Thank you very much by the time offered to this consultation.
Ricardo Alvarado Quirós
|
|
|
|
|
Well this one has me stumped.
How does one vertically align the contents of a DIV (without using a TABLE inside the DIV )?
For instance I have a DIV which is 100% wide and 100% high. I then have an IMG tag within the DIV and I want that IMG to center, both horizontally (which is done by using the text-align style attribute) and vertically (which is done... how?)
Using a TABLE to do this seems so inelegant and partly negates the use of a DIV.
regards,
Paul Watson
Cape Town, South Africa
e: paulmwatson@email.com
w: vergen.org
|
|
|
|
|
Paul,
From a CSS perspective the use of:
<DIV style="text-align: center; vertical-align: middle;"> should give the result you require. However, this appears to be browser dependent as usual. Dreamweaver 4 renders this correctly in it's preview window, but IE 5.5 does not. The image appears at the top of the window
From experience I have found that the cleanest and quickest way to get this result is to use a table with:
<TD align="center" valign="middle">
If I can help any further let me know.
Derek.
|
|
|
|
|
thanks for the suggestion Derek.
I also first saw DIV vertical alignment in Dreamweaver but was disapointed when IE did not render it properly.
Well I guess it is back to using the venerable TABLE
regards,
Paul Watson
Cape Town, South Africa
e: paulmwatson@email.com
w: vergen.org
|
|
|
|
|
Having only dabbled in XSL before and now being presented with a real project which requires it I need some help.
I have two XSL files, identical except for the specification declaration on the second line:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<xsl:variable name="countryid"><xsl:value-of select="country/@country"/></xsl:variable>
</xsl:template>
</xsl:stylesheet>
and
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:variable name="countryid"><xsl:value-of select="country/@country"/></xsl:variable>
</xsl:template>
</xsl:stylesheet>
As you can see the first one points to the w3.org/TR/WD-xsl specification and the second one points to the w3.org/1999/XSL/Transform specification. When I run the first one against an XML file on the client side Internet Explorer gives me the following error:
Keyword xsl:variable may not be used in namespace http://www.w3.org/TR/WD-xsl. Error processing resource
The second XSL works 100% however (though it does not work if you take out the version="1.0" parameter).
So my question is: Why? Why does it do this and how can I use xsl:variable on the client side while using what I believe to be the better and more recent w3.org/TR/WD-xsl specification.
Obviously I am missing something fundamental to XML and XSL, but it seems a rather illogical fundamental.
thanks!
regards,
Paul Watson
Cape Town, South Africa
e: paulmwatson@email.com
w: vergen.org
|
|
|
|
|
I know this is an old post, but I think I finally found the answer. I'm just getting into XSL and found this to be a bit of a problem too.
w3.org/TR/WD-xsl : This is an old working draft (WD) XSL specification. The version of the XSL translator that shipped with Internet Explorer in Win2000 supports this spec.
w3.org/1999/XSL/Transform : This is the standard spec from the W3C XSL Recommendation. It is a newer one than above and will support xsl:variable, xsl:output, etc.
Now here's where I ran into trouble. The second declaration above didn't work with MSXML 2.5 (the parser that shipped with Windows 2000) so I went to microsofts site to upgrade to MSXML 3.1. After the install, my developer tools ran great with the second spec, but IE would still not display the documents correctly. It turned out this was because the upgrade to MSXML 3.1 actually installs in side-by-side mode, which means it does not actually replace the old parser. To get this to work, microsoft has a fix that will run 3.1 in replace mode. You can get more information off the MSDN website. I recommend reading the MSXML Parser 3.0 Release notes.
Hope this helps.
Dave
|
|
|
|
|
I'm designing a component to be called from an ASP page on Window 2000 IIS 5.
Is it better for the component to be in a DLL or an EXE? The component will be doing data access via ADO and maintaining a look up table of database entries in memory.
Michael
|
|
|
|