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
- <BODY style="OVERFLOW: auto" vLink=#800080 link=#0000ff>
- <CENTER></CENTER>
- <P> </P><BR><INPUT onkeypress=entsub() onblur=shftfocus() id=Text1
- style="WIDTH: 402px; HEIGHT: 19px" size=1 name=inans> <BR><BR>
- <INPUT id=Text2
- style="WIDTH: 158px; HEIGHT: 19px" onfocus=shftfocus() size=1 name=dte readonly>
- <script>shftfocus()
- tmestmp()</script>
- <BR>
- <P> </P></FORM></BODY>
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
- function entsub()
- {
- if ((window.event.keyCode == 13))
- WriteScan();
- }
Expand|Select|Wrap|Line Numbers
- function WriteScan()
- {
- scan = document.theform.inans.value;
- tmstmp = document.theform.dte.value;
- theform.inans.value = "";
- }
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
- function WriteScan()
- {
- scan = document.theform.inans.value;
- tmstmp = document.theform.dte.value;
- docmd.runsql "insert into [Scan Table] in 'C:\Database.db' ([Scans],[Time Stamp]) Select '" & scan & "', #" & tmstmp & "#"
- theform.inans.value = "";
- }