473,398 Members | 2,212 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Running SQL from a web page?

I'm not sure if this better qualifies as an Access question or an XML question - unfortunately, I don't see how to list it as both.

Anyway, I'm sure no one has asked my question because it seems like it is far too simple of a task for anyone to wonder about unless they are completely ignorant - which is my case.

I have two text fields on my web page (feel free skip past this if you want - i promise this is an Access/XML question eventually):

Expand|Select|Wrap|Line Numbers
  1. <BODY style="OVERFLOW: auto" vLink=#800080 link=#0000ff>
  2. <CENTER></CENTER>
  3. <P>&nbsp;</P><BR><INPUT onkeypress=entsub() onblur=shftfocus() id=Text1 
  4. style="WIDTH: 402px; HEIGHT: 19px" size=1 name=inans> <BR><BR>
  5.  
  6. <INPUT id=Text2 
  7. style="WIDTH: 158px; HEIGHT: 19px" onfocus=shftfocus() size=1 name=dte readonly>
  8. <script>shftfocus()
  9. tmestmp()</script>
  10. <BR>
  11. <P>&nbsp;</P></FORM></BODY>
the function entsub checks to see if the key that was pressed is the "enter" key.

the function shftfocus always shifts the focus to the Text1 field

the function tmestmp simply puts a time stamp in Text2 at the loading of the page

here is the entsub function:
Expand|Select|Wrap|Line Numbers
  1. function entsub()
  2. {
  3.     if ((window.event.keyCode == 13))
  4.         WriteScan();
  5.  
  6. }
here is the WriteScan function:
Expand|Select|Wrap|Line Numbers
  1. function WriteScan()
  2. {
  3.     scan = document.theform.inans.value;
  4.     tmstmp = document.theform.dte.value;
  5.  
  6.  
  7.     theform.inans.value = "";
  8. }
Ultimately, this web page is set up for a scanner - someone plugs in a cheap USB scanner into their computer, opens this page, and scans stuff. Each time they complete a scan (with a character return at the end) it clears the field and starts over.

I apologize - this has all been web script so far, but all of this is stuff I know how to, I have done, and it is working just fine. My question is in the writescan function, I want to run an SQL statement that writes the variables 'scan' and 'tmstmp' into a table stored in a database that is on the same server as this webpage. In pseudocode the WriteScan function would simply have this addition:
Expand|Select|Wrap|Line Numbers
  1. function WriteScan()
  2. {
  3.     scan = document.theform.inans.value;
  4.     tmstmp = document.theform.dte.value;
  5.     docmd.runsql "insert into [Scan Table] in 'C:\Database.db' ([Scans],[Time Stamp]) Select '" & scan & "', #" & tmstmp & "#"    
  6.     theform.inans.value = "";
  7.  
  8. }
i realize this is actual code, but I call it pseudocode because it doesn't work at all. Anyone know what would work?
May 26 '11 #1
0 999

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Santa | last post by:
I am using Fritz Onion's "Asynchronous Pages" approach as mentioned in the article http://msdn.microsoft.com/msdnmag/issues/03/06/Threading/default.aspx to increase the performance of my ASPX...
5
by: Jim Heavey | last post by:
When should you use the Page.Validate() method? I thought you would use this method if you have some Server side validation (CustomControl's) you wanted to use and this would cause them to be...
0
by: Santa | last post by:
I am using Fritz Onion's "Asynchronous Pages" approach as mentioned in the article http://msdn.microsoft.com/msdnmag/issues/03/06/Threading/default.aspx to increase the performance of my ASPX...
5
by: Vishal | last post by:
Hello, I have an aspx page, which does certain tasks - like reading from the dbase, creating files comparing records etx. Now when this page runs, it obviously returns when the page is...
5
by: PontiMax | last post by:
Hi, when I press the OK button of my dialog box a long-running task is initiated. Therefore I would like to make visible a div section right after clicking the button where a user-friendly...
1
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the...
7
by: keyu | last post by:
hii All, I m Using C# I need to create a new Asp Page from Running Page on Button Click .. Can AnybodyHelp m .. Thakns for help , Byeeeeeeeeee
14
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So,...
0
by: shanmukhi | last post by:
Hi All, i am very new to crystal reports.. how can i run crystal report(rpt file) from a jsp page.. i tried somthing by getting code from google my applicaction structure is like this ...
8
by: gupta24 | last post by:
i am in critical position please help we have machines a,b,c,d in each machine application servers are running but each machine have 40 application server are running result of 40 application...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.