Syntax from URL in Access not loading

G

Guest

Hi, I have an MS Access form with a Web Browser in it which is loaded when
the form loads using the following code:
With webHome
.Navigate URL:="G:\ADAM\img\MBIScript.html?TimeOfDay=" & varTimeOfDay &
"&Agent=" & txtAgentSelected
Beep
Do While .Busy: DoEvents: Loop
Do While .ReadyState <> 4: DoEvents: Loop
End With

THe webpage uses this code to extract the syntax:

<script type="text/javascript">
function qsobj(parm)
{var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\+/g," ")) : null}

var TimeOfDay = qsobj(0)
var Agent = qsobj(1)
</script>

This works fine when I load the webpage from another webpage but when it
loads from Access I get Error: 'undefined' is null or not an object.
And the webpage loads up:
Good Morning&Agent, my name is undefined.

How do I fix this? I think it might be a problem with the
var qpairs = document.location.search.substring(1).split("&")
line and the document location with it being inside a Access form but I have
no idea how to fix it.
 
T

Thomas A. Rowe

This is not a FP related issue, you need to post to the Access newsgroup.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
G

Guest

So you don't think the problem is the script in my website, in particular the
line:
var qpairs = document.location.search.substring(1).split("&") ?

<script type="text/javascript">
function qsobj(parm)
{var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\+/g," ")) : null}

var TimeOfDay = qsobj(0)
var Agent = qsobj(1)
</script>

--
Adam Thwaites
Access Database Designer
adam.*spamless*[email protected]
Manchester, UK


Thomas A. Rowe said:
This is not a FP related issue, you need to post to the Access newsgroup.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

Adam Thwaites said:
Hi, I have an MS Access form with a Web Browser in it which is loaded when
the form loads using the following code:
With webHome
.Navigate URL:="G:\ADAM\img\MBIScript.html?TimeOfDay=" & varTimeOfDay &
"&Agent=" & txtAgentSelected
Beep
Do While .Busy: DoEvents: Loop
Do While .ReadyState <> 4: DoEvents: Loop
End With

THe webpage uses this code to extract the syntax:

<script type="text/javascript">
function qsobj(parm)
{var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\+/g," ")) : null}

var TimeOfDay = qsobj(0)
var Agent = qsobj(1)
</script>

This works fine when I load the webpage from another webpage but when it
loads from Access I get Error: 'undefined' is null or not an object.
And the webpage loads up:
Good Morning&Agent, my name is undefined.

How do I fix this? I think it might be a problem with the
var qpairs = document.location.search.substring(1).split("&")
line and the document location with it being inside a Access form but I have
no idea how to fix it.
--
Adam Thwaites
Access Database Designer
adam.*spamless*[email protected]
Manchester, UK
 
T

Thomas A. Rowe

Either way it is still not directly related to using FP.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

Adam Thwaites said:
So you don't think the problem is the script in my website, in particular the
line:
var qpairs = document.location.search.substring(1).split("&") ?

<script type="text/javascript">
function qsobj(parm)
{var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\+/g," ")) : null}

var TimeOfDay = qsobj(0)
var Agent = qsobj(1)
</script>

--
Adam Thwaites
Access Database Designer
adam.*spamless*[email protected]
Manchester, UK


Thomas A. Rowe said:
This is not a FP related issue, you need to post to the Access newsgroup.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

Adam Thwaites said:
Hi, I have an MS Access form with a Web Browser in it which is loaded when
the form loads using the following code:
With webHome
.Navigate URL:="G:\ADAM\img\MBIScript.html?TimeOfDay=" & varTimeOfDay &
"&Agent=" & txtAgentSelected
Beep
Do While .Busy: DoEvents: Loop
Do While .ReadyState <> 4: DoEvents: Loop
End With

THe webpage uses this code to extract the syntax:

<script type="text/javascript">
function qsobj(parm)
{var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\+/g," ")) : null}

var TimeOfDay = qsobj(0)
var Agent = qsobj(1)
</script>

This works fine when I load the webpage from another webpage but when it
loads from Access I get Error: 'undefined' is null or not an object.
And the webpage loads up:
Good Morning&Agent, my name is undefined.

How do I fix this? I think it might be a problem with the
var qpairs = document.location.search.substring(1).split("&")
line and the document location with it being inside a Access form but I have
no idea how to fix it.
--
Adam Thwaites
Access Database Designer
adam.*spamless*[email protected]
Manchester, UK
 
G

Guest

I'm programming the webpage in FP which is where I think the error is. If you
can't help there's no need in replying.
--
Adam Thwaites
Access Database Designer
adam.*spamless*[email protected]
Manchester, UK


Thomas A. Rowe said:
Either way it is still not directly related to using FP.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

Adam Thwaites said:
So you don't think the problem is the script in my website, in particular the
line:
var qpairs = document.location.search.substring(1).split("&") ?

<script type="text/javascript">
function qsobj(parm)
{var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\+/g," ")) : null}

var TimeOfDay = qsobj(0)
var Agent = qsobj(1)
</script>

--
Adam Thwaites
Access Database Designer
adam.*spamless*[email protected]
Manchester, UK


Thomas A. Rowe said:
This is not a FP related issue, you need to post to the Access newsgroup.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

Hi, I have an MS Access form with a Web Browser in it which is loaded when
the form loads using the following code:
With webHome
.Navigate URL:="G:\ADAM\img\MBIScript.html?TimeOfDay=" & varTimeOfDay &
"&Agent=" & txtAgentSelected
Beep
Do While .Busy: DoEvents: Loop
Do While .ReadyState <> 4: DoEvents: Loop
End With

THe webpage uses this code to extract the syntax:

<script type="text/javascript">
function qsobj(parm)
{var qpairs = document.location.search.substring(1).split("&")
var qvbl = qpairs[parm].split("=")
return qvbl[1] ? unescape(qvbl[1].replace(/%20|\+/g," ")) : null}

var TimeOfDay = qsobj(0)
var Agent = qsobj(1)
</script>

This works fine when I load the webpage from another webpage but when it
loads from Access I get Error: 'undefined' is null or not an object.
And the webpage loads up:
Good Morning&Agent, my name is undefined.

How do I fix this? I think it might be a problem with the
var qpairs = document.location.search.substring(1).split("&")
line and the document location with it being inside a Access form but I have
no idea how to fix it.
--
Adam Thwaites
Access Database Designer
adam.*spamless*[email protected]
Manchester, UK
 
S

Stefan B Rusynko

Access forms Do not work in web browsers
You need to use server side scripting (ASP) to connect to and use the Db in a browser
- if you don't know how to do that look at the FP DBRW

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| I'm programming the webpage in FP which is where I think the error is. If you
| can't help there's no need in replying.
| --
| Adam Thwaites
| Access Database Designer
| adam.*spamless*[email protected]
| Manchester, UK
|
|
| "Thomas A. Rowe" wrote:
|
| > Either way it is still not directly related to using FP.
| >
| > --
| > ==============================================
| > Thomas A. Rowe (Microsoft MVP - FrontPage)
| > ==============================================
| > If you feel your current issue is a results of installing
| > a Service Pack or security update, please contact
| > Microsoft Product Support Services:
| > http://support.microsoft.com
| > If the problem can be shown to have been caused by a
| > security update, then there is usually no charge for the call.
| > ==============================================
| >
| > | > > So you don't think the problem is the script in my website, in particular the
| > > line:
| > > var qpairs = document.location.search.substring(1).split("&") ?
| > >
| > > <script type="text/javascript">
| > > function qsobj(parm)
| > > {var qpairs = document.location.search.substring(1).split("&")
| > > var qvbl = qpairs[parm].split("=")
| > > return qvbl[1] ? unescape(qvbl[1].replace(/%20|\+/g," ")) : null}
| > >
| > > var TimeOfDay = qsobj(0)
| > > var Agent = qsobj(1)
| > > </script>
| > >
| > > --
| > > Adam Thwaites
| > > Access Database Designer
| > > adam.*spamless*[email protected]
| > > Manchester, UK
| > >
| > >
| > > "Thomas A. Rowe" wrote:
| > >
| > >> This is not a FP related issue, you need to post to the Access newsgroup.
| > >>
| > >> --
| > >> ==============================================
| > >> Thomas A. Rowe (Microsoft MVP - FrontPage)
| > >> ==============================================
| > >> If you feel your current issue is a results of installing
| > >> a Service Pack or security update, please contact
| > >> Microsoft Product Support Services:
| > >> http://support.microsoft.com
| > >> If the problem can be shown to have been caused by a
| > >> security update, then there is usually no charge for the call.
| > >> ==============================================
| > >>
| > >> | > >> > Hi, I have an MS Access form with a Web Browser in it which is loaded when
| > >> > the form loads using the following code:
| > >> > With webHome
| > >> > .Navigate URL:="G:\ADAM\img\MBIScript.html?TimeOfDay=" & varTimeOfDay &
| > >> > "&Agent=" & txtAgentSelected
| > >> > Beep
| > >> > Do While .Busy: DoEvents: Loop
| > >> > Do While .ReadyState <> 4: DoEvents: Loop
| > >> > End With
| > >> >
| > >> > THe webpage uses this code to extract the syntax:
| > >> >
| > >> > <script type="text/javascript">
| > >> > function qsobj(parm)
| > >> > {var qpairs = document.location.search.substring(1).split("&")
| > >> > var qvbl = qpairs[parm].split("=")
| > >> > return qvbl[1] ? unescape(qvbl[1].replace(/%20|\+/g," ")) : null}
| > >> >
| > >> > var TimeOfDay = qsobj(0)
| > >> > var Agent = qsobj(1)
| > >> > </script>
| > >> >
| > >> > This works fine when I load the webpage from another webpage but when it
| > >> > loads from Access I get Error: 'undefined' is null or not an object.
| > >> > And the webpage loads up:
| > >> > Good Morning&Agent, my name is undefined.
| > >> >
| > >> > How do I fix this? I think it might be a problem with the
| > >> > var qpairs = document.location.search.substring(1).split("&")
| > >> > line and the document location with it being inside a Access form but I have
| > >> > no idea how to fix it.
| > >> > --
| > >> > Adam Thwaites
| > >> > Access Database Designer
| > >> > adam.*spamless*[email protected]
| > >> > Manchester, UK
| > >>
| > >>
| > >>
| >
| >
| >
 
G

Guest

I briefly looked into using ASP but from what I read I need some sort of
server setup which I don't have the option to do on my work PCs.

After much farting around on Friday I found my solution, to put the HTML
directly into the VB code in access which works like a charm:

webBrowser.Navigate2 "about:Blank"
DoEvents
'webBrowser.Document.body.bgcolor = "#FFFFFF"
strHTML = _
"<body topmargin=""0"" leftmargin=""0"" rightmargin=""0""
bottommargin=""0"" marginwidth=""0"" marginheight=""0"">" & vbCrLf & _
"<table width=""100%"" style=""border-style: solid; border-width:
1px"">" & vbCrLf & _
"<tr>" & vbCrLf & _
"<td colspan=""1"" border=""0""><div align=""left"">" & vbCrLf & _
"<basefont face=""corpos"" size=""16px"" color=""#527BB9""><b>" & vbCrLf
& _
"Part 1: Agent Introduction</b><br>" & vbCrLf & _
"<basefont face=""corpos"" size=""14px"" color=""#000000"">" & vbCrLf & _
"Good " & TimeOfDay & ", my name is " & txtAgentSelected & ". I'm
calling from the Mercedes-Benz Retail Customer Support Unit. Can I speak to "
& varCustomersName & "? How are you today? <br>" & vbCrLf & _
"Great. The reason i'm calling is because I need to talk to you about
your warranty! Is this a convenient time to call? <br><br>" & vbCrLf & _
"You bought your " & txtClass & " from us " & lblCarAge.Caption & "
months ago. Do you still have it? <br>" & vbCrLf & _
"Brilliant. Well as i'm sure you're aware your warranty is just about to
expire " & varCustomersName & ". Did you realise that? <br><br>" & vbCrLf & _
"<i>(If No)</i> - Well, it's a good job I called you then! <br>" &
vbCrLf & _
"<i>(If Yes)</i> - Great!" & vbCrLf & _
"</td>" & vbCrLf & _
"</tr>" & vbCrLf & _
"</table>" & vbCrLf & _
"</body>" & vbCrLf & _
"</html>"

Wait (0.2)
webBrowser.Document.body.innerhtml = strHTML
--
Adam Thwaites
Access Database Designer
adam.*spamless*[email protected]
Manchester, UK


Stefan B Rusynko said:
Access forms Do not work in web browsers
You need to use server side scripting (ASP) to connect to and use the Db in a browser
- if you don't know how to do that look at the FP DBRW

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| I'm programming the webpage in FP which is where I think the error is. If you
| can't help there's no need in replying.
| --
| Adam Thwaites
| Access Database Designer
| adam.*spamless*[email protected]
| Manchester, UK
|
|
| "Thomas A. Rowe" wrote:
|
| > Either way it is still not directly related to using FP.
| >
| > --
| > ==============================================
| > Thomas A. Rowe (Microsoft MVP - FrontPage)
| > ==============================================
| > If you feel your current issue is a results of installing
| > a Service Pack or security update, please contact
| > Microsoft Product Support Services:
| > http://support.microsoft.com
| > If the problem can be shown to have been caused by a
| > security update, then there is usually no charge for the call.
| > ==============================================
| >
| > | > > So you don't think the problem is the script in my website, in particular the
| > > line:
| > > var qpairs = document.location.search.substring(1).split("&") ?
| > >
| > > <script type="text/javascript">
| > > function qsobj(parm)
| > > {var qpairs = document.location.search.substring(1).split("&")
| > > var qvbl = qpairs[parm].split("=")
| > > return qvbl[1] ? unescape(qvbl[1].replace(/%20|\+/g," ")) : null}
| > >
| > > var TimeOfDay = qsobj(0)
| > > var Agent = qsobj(1)
| > > </script>
| > >
| > > --
| > > Adam Thwaites
| > > Access Database Designer
| > > adam.*spamless*[email protected]
| > > Manchester, UK
| > >
| > >
| > > "Thomas A. Rowe" wrote:
| > >
| > >> This is not a FP related issue, you need to post to the Access newsgroup.
| > >>
| > >> --
| > >> ==============================================
| > >> Thomas A. Rowe (Microsoft MVP - FrontPage)
| > >> ==============================================
| > >> If you feel your current issue is a results of installing
| > >> a Service Pack or security update, please contact
| > >> Microsoft Product Support Services:
| > >> http://support.microsoft.com
| > >> If the problem can be shown to have been caused by a
| > >> security update, then there is usually no charge for the call.
| > >> ==============================================
| > >>
| > >> | > >> > Hi, I have an MS Access form with a Web Browser in it which is loaded when
| > >> > the form loads using the following code:
| > >> > With webHome
| > >> > .Navigate URL:="G:\ADAM\img\MBIScript.html?TimeOfDay=" & varTimeOfDay &
| > >> > "&Agent=" & txtAgentSelected
| > >> > Beep
| > >> > Do While .Busy: DoEvents: Loop
| > >> > Do While .ReadyState <> 4: DoEvents: Loop
| > >> > End With
| > >> >
| > >> > THe webpage uses this code to extract the syntax:
| > >> >
| > >> > <script type="text/javascript">
| > >> > function qsobj(parm)
| > >> > {var qpairs = document.location.search.substring(1).split("&")
| > >> > var qvbl = qpairs[parm].split("=")
| > >> > return qvbl[1] ? unescape(qvbl[1].replace(/%20|\+/g," ")) : null}
| > >> >
| > >> > var TimeOfDay = qsobj(0)
| > >> > var Agent = qsobj(1)
| > >> > </script>
| > >> >
| > >> > This works fine when I load the webpage from another webpage but when it
| > >> > loads from Access I get Error: 'undefined' is null or not an object.
| > >> > And the webpage loads up:
| > >> > Good Morning&Agent, my name is undefined.
| > >> >
| > >> > How do I fix this? I think it might be a problem with the
| > >> > var qpairs = document.location.search.substring(1).split("&")
| > >> > line and the document location with it being inside a Access form but I have
| > >> > no idea how to fix it.
| > >> > --
| > >> > Adam Thwaites
| > >> > Access Database Designer
| > >> > adam.*spamless*[email protected]
| > >> > Manchester, UK
| > >>
| > >>
| > >>
| >
| >
| >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top