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.

ASP technologies

3 posts in General Discussion Last posting was on 2003-07-30 00:05:02.0Z
Erik Aliaga Posted on 2003-07-18 19:59:31.0Z
From: "Erik Aliaga" <ealiaga@eica.com.ec>
Subject: ASP technologies
Date: Fri, 18 Jul 2003 14:59:31 -0500
Lines: 12
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <OrJ2MhWTDHA.298@forums-2-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: 122.red2-gye.satnet.net 200.63.197.122
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1402
Article PK: 3636

Dears
Freinds,

There is any way to could use ADO technologies with Sybase. I
need to use a ADO connection for work my intranet. If so possible, you could
to give a few samples that demostrates a transaction with this database.


Regards,
Erik Aliaga


Rick Blythe Posted on 2003-07-19 01:29:25.0Z
From: "Rick Blythe" <rickb@ianywhere.com>
References: <OrJ2MhWTDHA.298@forums-2-dub>
Subject: Re: ASP technologies
Date: Fri, 18 Jul 2003 21:29:25 -0400
Lines: 361
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
Message-ID: <#ZaUiZZTDHA.298@forums-2-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: d141-143-124.home.cgocable.net 24.141.143.124
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1405
Article PK: 3639

Here is a sample page I wrote in Dreamweaver MX



<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim MM_WR_STRING
MM_WR_STRING = "dsn=PremiumDSN;uid=dba;pwd=sql;"
%>

<%
' *** Edit Operations: declare variables

Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd

Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId

Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables

If (CStr(Request("MM_insert")) = "form1") Then

MM_editConnection = MM_WR_STRING
MM_editTable = "DBA.Tasks"
MM_editRedirectUrl = "bb.asp"
MM_fieldsStr =
"TaskType|value|Case|value|Description|value|Priority|value|emp_ID|value|Act
ive|value"
MM_columnsStr =
"TaskType|none,none,NULL|CaseNo|none,none,NULL|Description|',none,''|Priorit
y|none,none,NULL|emp_id|',none,''|Active|none,-1,0"

' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")

' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next

' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And
Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If

End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it

Dim MM_tableValues
Dim MM_dbValues

If (CStr(Request("MM_insert")) <> "") Then

' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)
If (MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "") Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End If
MM_tableValues = MM_tableValues & MM_columns(MM_i)
MM_dbValues = MM_dbValues & MM_formVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ")
values (" & MM_dbValues & ")"

If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If

End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_WR_STRING
Recordset1.Source = "SELECT TaskType, CaseNo, Description, Priority, emp_id,
Active FROM DBA.Tasks"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
Dim Recordset2
Dim Recordset2_numRows

Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_WR_STRING
Recordset2.Source = "SELECT * FROM TaskTypes ORDER BY Type ASC"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()

Recordset2_numRows = 0
%>
<%
Dim Recordset3__MMColParam
Recordset3__MMColParam = "6"
If (Request("MM_EmptyValue") <> "") Then
Recordset3__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim Recordset3
Dim Recordset3_numRows

Set Recordset3 = Server.CreateObject("ADODB.Recordset")
Recordset3.ActiveConnection = MM_WR_STRING
Recordset3.Source = "SELECT EmployeeID, Name FROM css.Employees WHERE Team =
" + Replace(Recordset3__MMColParam, "'", "''") + " ORDER BY Name ASC"
Recordset3.CursorType = 0
Recordset3.CursorLocation = 2
Recordset3.LockType = 1
Recordset3.Open()

Recordset3_numRows = 0
%>

<html><!-- InstanceBegin template="/Templates/WR.dwt"
codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>WarRoom</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>
<body bgcolor="#000000" text="00FF00" link="ff9900" vlink="ff9900"
alink="ff9900">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="left">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
b#version=6,0,29,0" name="BB" width="120" height="65" align="left" id="BB">
<param name="movie" value="bb.swf" />
<param name="WMode" value="Transparent">
<param name="quality" value="high" />
<param name="LOOP" value="false" />
<embed src="bb.swf" width="120" height="65" loop="False"
align="left" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" name="BB"></embed></object>
</div></td>
</tr>
</table>
<!-- InstanceBeginEditable name="EditRegion3" -->
<h3>.:Add Task:.</h3>
<form method="POST" action="<%=MM_editAction%>" name="form1">
<table>
<tr valign="baseline">
<td align="right" nowrap bordercolor="#663399" bgcolor="#663399"><font
size="-1"><b>Task
Type:</b></font></td>
<td><font size="-1">
<select name="TaskType" id="TaskType">
<%
While (NOT Recordset2.EOF)
%>
<option
value="<%=(Recordset2.Fields.Item("ID").Value)%>"><%=(Recordset2.Fields.Item
("Type").Value)%></option>
<%
Recordset2.MoveNext()
Wend
If (Recordset2.CursorType > 0) Then
Recordset2.MoveFirst
Else
Recordset2.Requery
End If
%>
</select>
</font></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap bordercolor="#663399" bgcolor="#663399"><font
size="-1"><b>Case:</b></font></td>
<td> <font size="-1">
<input type="text" name="Case" value="" size="10">
</font></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap bordercolor="#663399" bgcolor="#663399"><font
size="-1"><b>Description:</b></font></td>
<td> <font size="-1">
<input type="text" name="Description" value="" size="50">
</font></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap bordercolor="#663399" bgcolor="#663399"><font
size="-1"><b>Priority:</b></font></td>
<td> <font size="-1">
<select name="Priority" id="Priority">
<option value="1" <%If (Not isNull("3")) Then If ("1" = CStr("3"))
Then Response.Write("SELECTED") : Response.Write("")%>>1</option>
<option value="2" <%If (Not isNull("3")) Then If ("2" = CStr("3"))
Then Response.Write("SELECTED") : Response.Write("")%>>2</option>
<option value="3" <%If (Not isNull("3")) Then If ("3" = CStr("3"))
Then Response.Write("SELECTED") : Response.Write("")%>>3</option>
<option value="4" <%If (Not isNull("3")) Then If ("4" = CStr("3"))
Then Response.Write("SELECTED") : Response.Write("")%>>4</option>
</select>
</font></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap bordercolor="#663399" bgcolor="#663399"><font
size="-1"><b>Employee:</b></font></td>
<td><font size="-1">
<select name="emp_ID" id="emp_ID">
<%
While (NOT Recordset3.EOF)
%>
<option
value="<%=(Recordset3.Fields.Item("EmployeeID").Value)%>"><%=(Recordset3.Fie
lds.Item("Name").Value)%></option>
<%
Recordset3.MoveNext()
Wend
If (Recordset3.CursorType > 0) Then
Recordset3.MoveFirst
Else
Recordset3.Requery
End If
%>
</select>
</font></td>
</tr>
<tr valign="baseline">
<td align="right" nowrap bordercolor="#663399" bgcolor="#663399"><font
size="-1"><b>Active:</b></font></td>
<td> <font size="-1">
<input name="Active" type="checkbox" value=1 checked="checked" >
</font></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"><font size="-1">&nbsp;</font></td>
<td> <font size="-1">
<input type="submit" value="Insert Record">
</font></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
<!-- InstanceEndEditable -->
<!-- ******** BEGIN ALLWEBMENUS CODE FOR wr ******** -->
<img name='awmMenuPathImg-wr' id='awmMenuPathImg-wr' src='./awmmenupath.gif'
alt=''>
<script type='text/javascript'>var MenuLinkedBy='AllWebMenus [2]',
awmBN='486'; awmAltUrl='';</script>
<script src='wr.js' language='JavaScript1.2'
type='text/javascript'></script>
<script type='text/javascript'>awmBuildMenu();</script>
<!-- ******** END ALLWEBMENUS CODE FOR wr ******** -->
</body>
<!-- InstanceEnd --></html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
Recordset2.Close()
Set Recordset2 = Nothing
%>
<%
Recordset3.Close()
Set Recordset3 = Nothing
%>

--
_____________________
Rick Blythe
iAnywhere Solutions
"Erik Aliaga" <ealiaga@eica.com.ec> wrote in message
news:OrJ2MhWTDHA.298@forums-2-dub...
Dears
Freinds,

There is any way to could use ADO technologies with Sybase. I
need to use a ADO connection for work my intranet. If so possible, you could
to give a few samples that demostrates a transaction with this database.


Regards,
Erik Aliaga


Shuchit Velkar Posted on 2003-07-30 00:05:02.0Z
Newsgroups: ianywhere.public.general
Subject: Re: ASP technologies
From: Shuchit Velkar <me@privacy.net>
References: <OrJ2MhWTDHA.298@forums-2-dub>
Message-ID: <Xns93C7ACAE3D89CsvelkarNOsybaseSPAMc@10.22.241.106>
User-Agent: Xnews/5.04.25
NNTP-Posting-Host: svelkar-pc.sybase.com
X-Original-NNTP-Posting-Host: svelkar-pc.sybase.com
Date: 29 Jul 2003 17:05:02 -0700
X-Trace: forums-1-dub 1059523502 10.22.46.156 (29 Jul 2003 17:05:02 -0700)
X-Original-Trace: 29 Jul 2003 17:05:02 -0700, svelkar-pc.sybase.com
Lines: 26
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:1482
Article PK: 3712

"Erik Aliaga" <ealiaga@eica.com.ec> wrote in
news:OrJ2MhWTDHA.298@forums-2-dub:

> Dears
> Freinds,
>
> There is any way to could use ADO technologies with
> Sybase. I
> need to use a ADO connection for work my intranet. If so possible, you
> could to give a few samples that demostrates a transaction with this
> database.
>
>
> Regards,
> Erik Aliaga
>
>

See http://www.ianywhere.com/developer/technotes/sas_adonet.html
and http://www.ianywhere.com/whitepapers/ado_vb_access.html
and http://www.ianywhere.com/developer/technotes/connecting_sas_vb.html

If you are using ASP.NET
http://www.ianywhere.com/developer/technotes/asa_asp_net.html

Shuchit