Help with connection to Sybase database.. 
Author Message
 Help with connection to Sybase database..

I have a sybase database on an AIX box that I need to run a query on. I've
never played with Database stuff in code before, so I'm not sure exactly how
to do this. I'm doing this in script, but that shouldn't make much of a
difference as I just need help with the Open syntax and that should be the
same with anything.

Right now I'm running WinSQL connecting to "PacerViews" through Sybase SQL
Server connection with username and pass and running the following query:

Delete from FVAL_HOLD where {portcd = '000001'} and {profile_id = '107'}

portcode is a variable that I'm pulling from an INI file

How do I set up the connection.open string for this? Also, since I'm very
new to this, how can I tell whether my connections were successful or not?
Just some msgboxs with the appropriate "Success" / "Failure" will do.

So far I have:

'DelAcctSQL

const SERVER = "Sybase SQL Server"
const DATABASE = "PacerViews"
const TABLE = "FVAL_HOLD"

set con = CreateObject("ADODB.Connection")
set rec = CreateObject("ADODB.RecordSet")

portcode = 'get from INI file

con.Open  'Not sure how to set this up

rec.Open "delete from " & TABLE & " where portcd = ' " & portcode & " ' ",
con,
adOpenStatic

TIA

Matt



Sat, 07 May 2005 05:24:52 GMT  
 Help with connection to Sybase database..
Hi,

It depends on whether you want to connect through OLEDB provider or ODBC
driver and also depends on which provider/driver that you are using.
However, the following page lists many connection strings against many
commonly used database systems. So you can take a look at that and see
which one meets your requirement.
http://www.able-consulting.com/ado_conn.htm

Regards,
Elan Zhou
This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net?  http://www.gotdotnet.com



Sat, 07 May 2005 16:01:55 GMT  
 Help with connection to Sybase database..
Elan-

Nice page.. that helps quite a bit. I have a System DSN Setup already, so
should I just use that? Which is generally better for this kind of task?

TIA

Matt


Quote:
> Hi,

> It depends on whether you want to connect through OLEDB provider or ODBC
> driver and also depends on which provider/driver that you are using.
> However, the following page lists many connection strings against many
> commonly used database systems. So you can take a look at that and see
> which one meets your requirement.
> http://www.able-consulting.com/ado_conn.htm

> Regards,
> Elan Zhou
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Got .Net?  http://www.gotdotnet.com



Sat, 07 May 2005 21:12:00 GMT  
 Help with connection to Sybase database..
I think a DSN-less connection is a bit faster.

Brad


Quote:
> Elan-

> Nice page.. that helps quite a bit. I have a System DSN Setup already, so
> should I just use that? Which is generally better for this kind of task?

> TIA

> Matt



> > Hi,

> > It depends on whether you want to connect through OLEDB provider or ODBC
> > driver and also depends on which provider/driver that you are using.
> > However, the following page lists many connection strings against many
> > commonly used database systems. So you can take a look at that and see
> > which one meets your requirement.
> > http://www.able-consulting.com/ado_conn.htm

> > Regards,
> > Elan Zhou
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > Got .Net?  http://www.gotdotnet.com



Tue, 10 May 2005 02:38:00 GMT  
 Help with connection to Sybase database..
con.Open  "Driver={SYBASE ASE ODBC
Driver};Server=SERVERNAME;Database=DBNAME;Uid=USERNAME;Pwd=PASSWORD;"

for your connection (with appropriate substitutions for the upper case
parameters).


Quote:
> I have a sybase database on an AIX box that I need to run a query on. I've
> never played with Database stuff in code before, so I'm not sure exactly
how
> to do this. I'm doing this in script, but that shouldn't make much of a
> difference as I just need help with the Open syntax and that should be the
> same with anything.

> Right now I'm running WinSQL connecting to "PacerViews" through Sybase SQL
> Server connection with username and pass and running the following query:

> Delete from FVAL_HOLD where {portcd = '000001'} and {profile_id = '107'}

> portcode is a variable that I'm pulling from an INI file

> How do I set up the connection.open string for this? Also, since I'm very
> new to this, how can I tell whether my connections were successful or not?
> Just some msgboxs with the appropriate "Success" / "Failure" will do.

> So far I have:

> 'DelAcctSQL

> const SERVER = "Sybase SQL Server"
> const DATABASE = "PacerViews"
> const TABLE = "FVAL_HOLD"

> set con = CreateObject("ADODB.Connection")
> set rec = CreateObject("ADODB.RecordSet")

> portcode = 'get from INI file

> con.Open  'Not sure how to set this up

> rec.Open "delete from " & TABLE & " where portcd = ' " & portcode & " ' ",
> con,
> adOpenStatic

> TIA

> Matt



Wed, 11 May 2005 05:30:27 GMT  
 Help with connection to Sybase database..

strConn = "Driver={SYBASE ASE ODBC Driver};" & _
     "Srvr=" & sServerName & ";" & _
     "Uid=" & sUserName & ";" & _
     "Pwd=" & sPassword & ";" & _
     "Database=" & sDatabaseName & ";"

cn.Open strConn



Quote:
> con.Open  "Driver={SYBASE ASE ODBC
> Driver};Server=SERVERNAME;Database=DBNAME;Uid=USERNAME;Pwd=PASSWORD;"

> for your connection (with appropriate substitutions for the upper case
> parameters).



> > I have a sybase database on an AIX box that I need to run a query on.
I've
> > never played with Database stuff in code before, so I'm not sure exactly
> how
> > to do this. I'm doing this in script, but that shouldn't make much of a
> > difference as I just need help with the Open syntax and that should be
the
> > same with anything.

> > Right now I'm running WinSQL connecting to "PacerViews" through Sybase
SQL
> > Server connection with username and pass and running the following
query:

> > Delete from FVAL_HOLD where {portcd = '000001'} and {profile_id = '107'}

> > portcode is a variable that I'm pulling from an INI file

> > How do I set up the connection.open string for this? Also, since I'm
very
> > new to this, how can I tell whether my connections were successful or
not?
> > Just some msgboxs with the appropriate "Success" / "Failure" will do.

> > So far I have:

> > 'DelAcctSQL

> > const SERVER = "Sybase SQL Server"
> > const DATABASE = "PacerViews"
> > const TABLE = "FVAL_HOLD"

> > set con = CreateObject("ADODB.Connection")
> > set rec = CreateObject("ADODB.RecordSet")

> > portcode = 'get from INI file

> > con.Open  'Not sure how to set this up

> > rec.Open "delete from " & TABLE & " where portcd = ' " & portcode & " '
",
> > con,
> > adOpenStatic

> > TIA

> > Matt



Sat, 14 May 2005 11:52:20 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Database object won't drop Sybase connection

2. Database object won't drop Sybase connection

3. How To:? VB connection to Sybase database

4. How To:? VB connection to Sybase database

5. Help - Connection to Sybase via VBSQL

6. HELP with Sybase VB RDO Connection

7. HELP with Sybase VB RDO Connection

8. Dropping SYBASE connections

9. Connection from Access to Sybase.

10. VB connection to Sybase Adaptive Server

11. Sybase ADO Connection

12. URGENT - ADO connection to Sybase 11 code fragment needed

 

 
Powered by phpBB® Forum Software