How can I connect to an ASA6 DSN using ADO?

As sbj


0
Savvoulidis
8/3/2002 5:20:38 PM
sybase.sqlanywhere.general 32637 articles. 4 followers. Follow

7 Replies
372 Views

Similar Articles

[PageSpeed] 0

Here is a sample:

<HTML>
<HEAD>
<TITLE>ADO Example</TITLE>
</HEAD>
<BODY>
<%
Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open "DSN=asademo"
Set RS=MyConn.Execute("SELECT * FROM Department")
%>
<table border=1>
<tr>
<% for i=0 to RS.Fields.Count -1 %>
<TH>
<%= RS(i).Name %>
</TH>
<% Next %>
</TR>
<% WHILE NOT RS.EOF %>
<TR>
<% for i=0 to RS.Fields.Count -1 %>
<TD>
<%= RS(i) %>
</TD>
<% Next %>
</TR>
<%
RS.MoveNext
WEND
RS.Close
MyConn.Close
%>
</Table>
</BODY>
</HTML>



0
Rick
8/5/2002 12:24:04 PM
Thanks for the reply. I forgot to mention that I use Win2000 with its IIS
This is the simplest code to use and I already have tried it.

But the problem is to connect in ASA 6.
I have used all possible combinations as below:

' Does not work
anv_conn.Open( "Provider=MSDASQL.1;Driver={Adaptive Server Anywhere
6.0};Data Source=INFOTECHNICA;")

' this works but it connects to an ACCESS database. No problem between MS
apps huhh!!!
anv_conn.Open( "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\mystuff\infotech\infotech.mdb;Persist Security Info=False")

' Does not work
anv_conn.Open "DSN=INFOTECHNICA" ';Driver={Adaptive Server Anywhere 6.0};")

' Does not work
anv_conn.Open "DSN=INFOTECHNICA")

' Does not work
anv_conn.Open("File name=C:\mystuff\infotech\Internet\infotech.udl;")

and many more combinations...

Although I can create a DB connection inside the Visual Interdev, and see
all tables, procs of ASA6 db
I can't connect through code.

The ODBC 'Test Connection' button, connects me to the specified ASA6 DB!!!

I also use the text in the .UDL file that was produced automatically, but I
had no luck, although I can connect in the VIDev
using this .UDL!!!!

I also set the access priviledges to the internet guest user to the ASA
system32 directory (no luck again)

HEEEELP!!




0
Savvoulidis
8/6/2002 9:31:26 AM
Make sure your DSN is a SYSTEM DSN not a user DSN


0
Rick
8/6/2002 11:51:53 AM
It is already. My mind is going nuts!!!
What's wrong?


0
Savvoulidis
8/6/2002 6:52:36 PM
A couple of more things to try:

In the DSN, enable the checkboxes labeled
    Microsoft applications
    Prevent driver not capable
On the network tab - make sure tcpip is checked

I don't see a user_id and password in your code, so I am assuming your have
it specified in the DSN - right?


0
Rick
8/7/2002 12:10:01 PM
No luck at all  :(


0
Savvoulidis
8/14/2002 8:38:57 PM
 set anv_conn = server.CreateObject("ADODB.Connection")

 'anv_conn.Open( "Provider=MSDASQL.1;Driver={Adaptive Server Anywhere
6.0};Data Source=INFOTECHNICA;")
 'anv_conn.Open( "Provider=MSDASQL.1;DSN=INFOTECHNICA")
' anv_conn.Open( "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\mystuff\infotech\infotech.mdb;Persist Security Info=False")
 'anv_conn.Open "DSN=INFOTECHNICA;Initial
Catalog=INFOTECHNICA;Driver={Adaptive Server Anywhere 6.0};"
 'anv_conn.Open("File name=C:\mystuff\infotech\Internet\infotech.udl;")

 if anv_conn.errors.count > 0 then
.....
 end if
---------------------------
Only the connection with MS Access works.
All the other connection strings for ASA6 ODBC DSN do not work!! through
code
although they work in PB or inside the MS Videv 6
Heeeelp!



0
Savvoulidis
8/14/2002 8:45:48 PM
Reply:

Similar Artilces:

How can I connect to an ASA6 ODBC using ADO and vbscript?
Athough I have the ODBC connection working in PB or Visual Interdev environment, I can't connect through code When I mean 'through code' I mean ASP and vbscript. Post this question to the ASA newsgroup sybase.public.sqlanywhere.general and please provide your connection code. /ck "Savvoulidis Iordanis" <iordanis@hotmail.com> wrote in message news:Kbu7WHKQCHA.259@forums.sybase.com... > When I mean 'through code' I mean ASP and vbscript. > > > ...

If I use javascript in my pages, can I still use ADO to connect to SQL server?
I'm not exactly sure what I'm doing here.  (I'm sure it shows)  I want to start using javascript and ajax in my ASP.net pages, but am currently using ADO (I think) to communicate with my SQL server.  Here's a sample script..   Dim objConn As New SqlConnection(ConfigurationSettings.AppSettings("DSN")) Dim objCmd As SqlCommand Dim objRdr As SqlDataReader  Sub LoadMenubar()  Try   objConn.Open()   objCmd = New SqlCommand("SELECT * FROM Menubar ORDER BY Priority", objConn) &...

how can i write a connection string using DSN
i've used OleDb to connect and manipulate an access DB using direct connections and it worked well. now i need to make use of the advantages of using ODBC so that if i change the DB any time i only need to change the DSN setting on the machine but nothing needs to b changed in the code. i've setup the dsn of the access DB on the machine but i cant get it to work..how am i supposed to write the connection string? i've tried: "Driver={Microsoft Access Driver (*.mdb)};DBQ=E:\\Inetpub\\wwwroot\\ghadeer\\Data\\data.mdb;Dsn=sms-access.57" it worked but i dont want to write...

Can't Connect using ADO!
I give up! I have read the setup 100 times and I am still failing. I am receiving the attached error. I have looked in the Assembly directory and the Oracle.DataAccess is there (Version 2.102.2.20). I have added almost every direcory to my system path but still no go. Any ideas? Chris Craft begin 666 ADOError.doc MT,\1X*&Q&N$`````````````````````/@`#`/[_"0`&```````````````! M````3@``````````$ ``4 ````$```#^____`````$T```#_____________ M____________________________________________________________ M_________________________________________________________...

How can I use ADO or LDAP to connect AD
Dear sir :  I am new to asp.net 2.0,and I search article in this forum to study  I want to manage user account and group with asp.net web interface, and it can use textbox to create、query、delete、update account information I don't know how to start,please help. many thanks   Hi james,May this useful link help you http://www.codeproject.com/cs/system/everythingInAD.asp  Thanks,Manach....

Deploying ASA6 and using DSN-less connections...
Hi, After much research and trial and error, I have come up with a method of easily deploying ASA6 with my PowerBuilder 5 application (I would imagine all would still work with higher versions as well) and also of connecting to my ASA database without creating an ODBC Data Source (DSN). I noticed that this topic is asked about frequently, but I was unable to find a simple solution so I'd lke to contribute this one. I have tested this method on my Windows 95, 98 and 2000 environments, with complete success. If you have any comments about my method, please pass them along. ...

Can I use DSN less to connect database
Hi, Can I use DSN less to connect database, like connect to *.mdb? from LEO ...

Deploying ASA6 and using DSN-less connections... #2
Hi, After much research and trial and error, I have come up with a method of easily deploying ASA6 with my PowerBuilder 5 application (I would imagine all would still work with higher versions as well) and also of connecting to my ASA database without creating an ODBC Data Source (DSN). I noticed that this topic is asked about frequently, but I was unable to find a simple solution so I'd lke to contribute this one. I have tested this method on my Windows 95, 98 and 2000 environments, with complete success. If you have any comments about my method, please pass them along. ...

DSN Less Connection using ADO in VB to SQLAny 5.x
Is their a way to create a DSNLess connection to SQL Anywhere 5.x on an NT 4.0 Server using ADO 2.x and VB 6.0? I can do this with MS SQL Server with no problems. I can do this through PowerBuilder so you should be able to do it through your tool. I don't do VB so I can't give you an example. In your connection string you'll have to indicate the name of the driver, "Sybase SQL Anywhere 5.0", startup parameters, and the location of the database file. -- Jim Egan [TeamSybase] Houston, TX http://www.eganomics.com Sybase Developers Network http://...

Why we use Web.Config File for connection string wether we can use class Library for get connection for whole web Application
 Why we use Web.Config File for connection string wether we can use class Library for get connection for whole web Application  please help me? Friend, Web.config has its own advantages. 1) Web.Config is used to store the important information like connections strings etc...so that it can be modified even after the code has been    deployed to the server without compiling the entire application again. 2) Since it is a XML file, there is no need of building the project of you are going to change the connection strings.   If you go for the class files,...

How can I connect with pb 10.2.0 and sqlserver 8.0 using ado
Using ado what connection options should i choise because i have problem with the date date and datetime fields. Here is the syntax // Profile ado_profile SQLCA.DBMS = "ADO.NET" SQLCA.LogPass = <***> SQLCA.LogId = "sa" SQLCA.AutoCommit = False SQLCA.DBParm = "Namespace='System.Data.OleDb',Provider='SQLOLEDB',DataSource='NS2\ERP',Data base='SYMPER',DateTimeFormat='dd/mm/yyyy',DateFormat='dd/mm/yyyy',OJSyntax=' PB'" what is wrong ? what can i do ? thanks in advance nick Why use...

is ODBC DSN required in eVB? can't use OLE DB connection string parameters
I am using eVB on the Pocket PC to connect to an ASA 8.0 database using ADOCE. I'm running into a problem with the ADOCE Connection's ConnectionString parameter. Seems to work just fine if you have a DSN file containing ODBC parameters, such as the "ASA 8.0 Sample.dsn" file installed with the ASA samples. In fact all the ASA samples rely on these DSN files and when setting up the ADO connection just set ConnectionString="Data Source=<DSN file name>". What I'd like to do is specify all the connection parameters in the ConnectionString, like yo...

Why use parts of Ado.net when you can use SQL
Just on this line of thought. Why use objects such as DataTable,DataRow,DataColumn when you can use SQL to select and insert data more effectively. I have been creating applications that use sql queries and stored procedures. The other way to do it would be to use ADO.nets objects that help you like DataTable,DataRow, DataColumn. I hardly ever use them at all so are they really worth going into in depth. I prefer SQL to do all my data manipulation.MCAD.Net vb.net Perhaps you should explain how you use sql queries and stored procedures and how you think they're more effective. I f...

Web resources about - How can I connect to an ASA6 DSN using ADO? - sybase.sqlanywhere.general

First Capital Connect - Wikipedia, the free encyclopedia
( FCC ) is a British train operating company , owned by FirstGroup , operating the Thameslink Great Northern franchise . FCC operates passenger ...

Connect
mobile photography technology, culture and community www.dpreview.com News Reviews Features Phones Tablets Cameras Apps Forums Mobile photography ...

CloudCraze Connects Consumers To Facebook Brands Via Cloud Technology
Brands on Facebook are always looking for new, efficient ways to connect with customers . CloudCraze, which recently released its 3.0 e-commerce ...

Australian app Sociabl connects fan with their idols
Just into their 20s, cousins Brandon Reynolds and Jarrad Hrotek are set to launch a video call app that connects celebrities with their fans ...

Ford Seeks Out Software to Connect Drones With F-150s
Next time a devastating tsunami or earthquake strikes, Ford Motor Co. wants the rapid-response vehicle to be an F-150 pickup with a drone in ...

Movesum step-tracking app connects how you move with what you eat
... your funny bone . Movesum Lifesum - Healthier living, better eating, more movement Pedometer++ Moves Movesum step-tracking app connects ...

Ford seeks out software to connect drones with F-150s
News about global automotive manufacturing, with an emphasis on U.S. production.

How different networking standards are competing to connect the Internet of Things
The Internet of Things (IoT) — a vast network of connected devices — is set to become the world’s largest device market over the next decade, ...

SanDisk’s Wireless Connect 200GB Flash Drive Streams and Shares Without Plugging In
The SanDisk Wireless Connect 200GB flash drive is just huge. Besides its size, it also connects over password protected Wi-Fi to let you transfer ...

Solar Plants: UK’s Lightsource Connects 100 MW Of Solar In December
Lightsource Renewable Energy has announced the connection of 23 new sites in December, totaling more than 100MW of new capacity. This is a solid ...

Resources last updated: 1/16/2016 1:04:29 PM