|
|
 |
Re: FN-FORUM ASP opportunity
date posted 29th September 2002 17:30
Andy,
I love you, thanks!
John
Andy Stafford wrote:
>This is what I use for Access. Causes me no trouble. Obviously it doesn't
>need to be in a function, but I copied it from an include file just as an
>example.
>
>HTH
>
>Andy
>
>
>
>dim gobjCmd
>
>set gobjCmd=gCreateConnection
>
>
>strSQL="UPDATE client_emails set viewed=true where client_id=1"
>gobjCmd.CommandText=strSQL
>gobjCmd.Execute
>
>
>function gCreateConnection
>
> dim objCon, objCmd
> dim strDSN
> dim intError
>
> strDSN="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" &
>server.mappath("\_shared\_datacrest.mdb")
>
> 'Create some objects
> set objCmd = CreateObject("ADODB.Command")
> set objCon = CreateObject("ADODB.Connection")
>
> 'Open the connection
> with objCon
> .CommandTimeout = 30
> .ConnectionTimeout = 15
> .CursorLocation = 3
> .Open strDSN
> end with
>
> objCmd.ActiveConnection = objCon
>
> set gCreateConnection=objCmd
>
> set objCmd=Nothing
> set objCon=Nothing
>
>end function
>%>
>----- Original Message -----
>From: "john anslow" [EMAIL REMOVED]
>To: [EMAIL REMOVED]
>Sent: Sunday, September 29, 2002 4:15 PM
>Subject: Re: FN-FORUM ASP opportunity
>
>
>>The problem appears to be that I am using a dnsless connection, I can do
>>this using a normal odbc set up but I really want to be able to do it
>>without!
>>
>>It seems to me that it opens the connection ok but perhaps in read
>>rather than write mode, either that or I need to assign a name to the
>>connection so that I can then refer to it in the insert statement
>>seperately.
>>
>>God this is driving me nuts!
>>
>>John
>>
>>Anthony Johnston . Antix wrote:
>>
>>>commandtext is not on the connection object
>>>just put it in execute statement
>>>
>>>dmdTemp.Execute("INSERT blaaaa....")
>>>
>>>:) Ant.
>>>
>>>-----Original Message-----
>>>From: [EMAIL REMOVED]
[EMAIL REMOVED] Behalf Of john anslow
>>>Sent: 29 September 2002 12:48
>>>To: [EMAIL REMOVED]
>>>Subject: FN-FORUM ASP opportunity
>>>
>>>
>>>Hi guys,
>>>
>>>need a bit of help from the asp gurus amongst you.
>>>
>>>I'm using a direct connection to an access db which works fine for
>>>select statements but errors for inserts, here's the code I'm using and
>>>the error I'm getting.
>>>
>>>Can anyone cast any light on why it's not working?
>>>
>>>
>>> Set dmdTemp = Server.CreateObject("ADODB.Connection")
>>> dmdTemp.Provider = "Microsoft.Jet.OLEDB.4.0"
>>> dmdTemp.ConnectionString = "Data
>>>Source=d:websitessitenamefolderdatadtabase.mdb;"
>>> dmdTemp.Open
>>> dmdTemp.CommandText="INSERT INTO `homepage`
>>>
>>(description,twso,price)VALUES('"+description+"','"+twso+"',''"+price+"')"
>>
>>> dmdTemp.CommandType=1
>>> dmdTemp.Execute
>>>
>>>gives me the following error
>>>
>>>Microsoft VBScript runtime error '800a01be'
>>>
>>>Object doesn't support named arguments: 'CommandText'
>>>
>>>/cccomputing/scripts/addahp.asp , line 18
>>>
>>>TIA,
>>>
>>>John
>>>
>>--
>>
>>Fatfriar Productions
>>
>>"With you every step of the way"
>>
>>Website Design and Production at a reasonable rate and with a level of
>>service second to none.
>>
>>Web: http://www.Fatfriar.com E-mail: [EMAIL REMOVED]
>>
>>Telephone: +44 (0)208 405 4151
>>
>>Mobile telephone: +44 (0)7798 746 685
>>
>>Go Beyond Your Limitations...
>>
>>
>>The information in this message is confidential and may be legally
>>privileged. It is intended solely for the addressee. Access to this
>>message by anyone else is unauthorised. If you are not the intended
>>recipient, any disclosure, copying, or distribution of the message, or
>>any action or omission taken by you in reliance on it, is prohibited and
>>may be unlawful. Please contact the sender immediately if you have
>>received this message in error. Thank you.
>>
>>
>>
>>
>>============================================================
>>= Advanced web hosting solutions from Saffas. =
>>= Unix, PHP, mySQL, SSL, Perl, Control Panel, 24/7 access. =
>>= Why pay more for less? http://www.saffas.com =
>>============================================================
>>
>>Sponsor the forum for as little as £1 at:
>>
>>http://www.freelancers.net/cgi/sponsor.cgi?action=show
>>
>>
>>Advertise with Freelancers.net +Additions+
>>
>>http://www.freelancers.net/advert.php
>>
>>
>>Freelancers and Freelance Jobs:
>>http://www.freelancers.net
>>
>>Forum FAQs:
>>http://freelancers.netrickery.com
>>
>>To unsubscribe please email:
[EMAIL REMOVED]
>>
>>If you have difficulties unsubscribing please email:
[EMAIL REMOVED]
>>
>
>
>
>============================================================
>= Advanced web hosting solutions from Saffas. =
>= Unix, PHP, mySQL, SSL, Perl, Control Panel, 24/7 access. =
>= Why pay more for less? http://www.saffas.com =
>============================================================
>
>Sponsor the forum for as little as £1 at:
>
>http://www.freelancers.net/cgi/sponsor.cgi?action=show
>
>
>Advertise with Freelancers.net +Additions+
>
>http://www.freelancers.net/advert.php
>
>
>Freelancers and Freelance Jobs:
>http://www.freelancers.net
>
>Forum FAQs:
>http://freelancers.netrickery.com
>
>To unsubscribe please email:
[EMAIL REMOVED]
>
>If you have difficulties unsubscribing please email:
[EMAIL REMOVED]
>
--
Fatfriar Productions
"With you every step of the way"
Website Design and Production at a reasonable rate and with a level of
service second to none.
Web: http://www.Fatfriar.com E-mail: [EMAIL REMOVED]
Telephone: +44 (0)208 405 4151
Mobile telephone: +44 (0)7798 746 685
Go Beyond Your Limitations...
The information in this message is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorised. If you are not the intended
recipient, any disclosure, copying, or distribution of the message, or
any action or omission taken by you in reliance on it, is prohibited and
may be unlawful. Please contact the sender immediately if you have
received this message in error. Thank you.
|
 |
|