Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Connect to SQL Anywhere 10 using ASP Script

2 posts in General Discussion Last posting was on 2007-03-20 13:22:04.0Z
Avaal Technology Solutions Posted on 2007-03-19 16:41:12.0Z
From: "Avaal Technology Solutions" <admin@avaal.com>
Newsgroups: ianywhere.public.general
Subject: Connect to SQL Anywhere 10 using ASP Script
Lines: 61
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
NNTP-Posting-Host: bas13-toronto12-1167986509.dsl.bell.ca
X-Original-NNTP-Posting-Host: bas13-toronto12-1167986509.dsl.bell.ca
Message-ID: <45febd28$1@forums-1-dub>
Date: 19 Mar 2007 08:41:12 -0800
X-Trace: forums-1-dub 1174322472 69.158.15.77 (19 Mar 2007 08:41:12 -0800)
X-Original-Trace: 19 Mar 2007 08:41:12 -0800, bas13-toronto12-1167986509.dsl.bell.ca
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5901
Article PK: 1885

Hello,

I am having difficulty establishing a connection to a database I created
using SQL Anywhere 10, through my ASP scripting.

I developed a web application in ASP where members would fill out an online
form and the information would be recorded into an MS Access Database.

It is a very simple form that records the users Name, Email, & Company using
the resquest.form command in asp.

Code:

<%
name = request.form("name")
email = request.form("email")
company = request.form("company")

Once the information is captured, I establish a connection to the MS Access
database and store the information, as shown below. Is it possible to
establish a connection to a SQL Anywhere 10 DB through ASP Scripting? If so,
can you please provide me with an cor just alter the code below so it will
work with a SQL Anywhere 10 DB.

ConnString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" &
Server.MapPath("member.mdb")

set my_conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open ConnString
set rscheck = my_conn.Execute ("Select email from member where email='" &
email & "'")

if rscheck.eof then
been_here_before="No"
end if

RScheck.close
set rs = server.CreateObject("adodb.recordset")
if been_here_before="No" then
sql ="select * from member"

RS.open Sql,my_conn,1,3
RS.AddNew
RS("Name")=name
RS("Email")=email
RS("Company")=company
RS("memberdate")= now()
RS("Phone") = phone
RS("Lastlogin") = timenow

RS.update
%>

Please note that I am running the asp script, and have the Access DB stored
in my wwwroot folder, in my inetpub. I am using IIS on Windows XP Pro. I can
run the application on my IIS with no issues, and it writes to the database
without a problem.

Thank you!


Rob Waywell Posted on 2007-03-20 13:22:04.0Z
From: "Rob Waywell" <rwaywell_no_spam_please@ianywhere.com>
Newsgroups: ianywhere.public.general
References: <45febd28$1@forums-1-dub>
Subject: Re: Connect to SQL Anywhere 10 using ASP Script
Lines: 91
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: rwaywell-xp2.sybase.com
X-Original-NNTP-Posting-Host: rwaywell-xp2.sybase.com
Message-ID: <45ffdffc$1@forums-1-dub>
Date: 20 Mar 2007 05:22:04 -0800
X-Trace: forums-1-dub 1174396924 10.25.98.235 (20 Mar 2007 05:22:04 -0800)
X-Original-Trace: 20 Mar 2007 05:22:04 -0800, rwaywell-xp2.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5904
Article PK: 1882

Welcome to the Sybase iAnywhere newsgroups. One thing you will notice over
time is that many of the people who actively monitor these groups do check
many of the groups each day. This means that there is no benefit to cross
posting. I have forwarded your post from the Afaria trial newsgroup to the
sybase.public.sqlanywhere.general newsgroup which is the best place for this
question. Please follow up the thread in that newsgroup.

--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports:
http://case-express.sybase.com/cx/cx.stm?starturl=casemessage.ssc?CASETYPE=Bug

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

"Avaal Technology Solutions" <admin@avaal.com> wrote in message
news:45febd28$1@forums-1-dub...
> Hello,
>
> I am having difficulty establishing a connection to a database I created
> using SQL Anywhere 10, through my ASP scripting.
>
> I developed a web application in ASP where members would fill out an
> online form and the information would be recorded into an MS Access
> Database.
>
> It is a very simple form that records the users Name, Email, & Company
> using the resquest.form command in asp.
>
> Code:
>
> <%
> name = request.form("name")
> email = request.form("email")
> company = request.form("company")
>
> Once the information is captured, I establish a connection to the MS
> Access database and store the information, as shown below. Is it possible
> to establish a connection to a SQL Anywhere 10 DB through ASP Scripting?
> If so, can you please provide me with an cor just alter the code below so
> it will work with a SQL Anywhere 10 DB.
>
> ConnString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" &
> Server.MapPath("member.mdb")
>
> set my_conn= Server.CreateObject("ADODB.Connection")
> my_Conn.Open ConnString
> set rscheck = my_conn.Execute ("Select email from member where email='" &
> email & "'")
>
> if rscheck.eof then
> been_here_before="No"
> end if
>
> RScheck.close
> set rs = server.CreateObject("adodb.recordset")
> if been_here_before="No" then
> sql ="select * from member"
>
> RS.open Sql,my_conn,1,3
> RS.AddNew
> RS("Name")=name
> RS("Email")=email
> RS("Company")=company
> RS("memberdate")= now()
> RS("Phone") = phone
> RS("Lastlogin") = timenow
>
> RS.update
> %>
>
> Please note that I am running the asp script, and have the Access DB
> stored in my wwwroot folder, in my inetpub. I am using IIS on Windows XP
> Pro. I can run the application on my IIS with no issues, and it writes to
> the database without a problem.
>
> Thank you!
>