Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sybase database

Status
Not open for further replies.

mic12345

Programmer
Jun 19, 2002
14
US
Hi,

Can I talk to SYBASE database by using VBScript???

Thanks in advance
 
I extract data from a table in Sybase SQL Anywhere 5.0 using a vb Script. I don't directly attach to Sybase though. I've got an Access Database that has an ODBC link to the Sybase table. I could post the code if it would help you.

mapman04
 
Here's the code.

mapman04

==========
' Unload and reload Table Order_header with data from sysbase table

Dim dbe,MyDB,Rs,strTable,strSQL,lngRecCo,Rs1

Set dbe = CreateObject("DAO.DBEngine.36")

Set MyDB = dbe.Workspaces(0).OpenDatabase("\\Server\Database\Database.mdb")

strSQL = "DELETE * FROM order_header;"

myDB.Execute strSQL


strSQL = "INSERT INTO Order_Header ( head_order_nbr, account_number, head_date, po_number, head_user1," _
& " head_user2, head_user3, head_user4, head_user5, head_user6, head_user7, head_user8, updated," _
& " shipto_id, last_transfer_tag, alt_account_name )"

strSQL = strSQL & " SELECT DBA_order_header.head_order_nbr, DBA_order_header.account_number," _
& " DBA_order_header.head_date, DBA_order_header.po_number, DBA_order_header.head_user1," _
& " DBA_order_header.head_user2, DBA_order_header.head_user3, DBA_order_header.head_user4," _
& " DBA_order_header.head_user5, DBA_order_header.head_user6, DBA_order_header.head_user7," _
& " DBA_order_header.head_user8, DBA_order_header.updated, DBA_order_header.shipto_id," _
& " DBA_order_header.last_transfer_tag, DBA_order_header.alt_account_name"

strSQL = strSQL & " FROM DBA_order_header" _
& " WHERE (((DBA_order_header.head_order_nbr) Like 'CO*' Or (DBA_order_header.head_order_nbr) Like 'R*'));"

myDB.Execute strSQL

myDB.Close

Set myDB = Nothing
Set dbe = Nothing

WScript.Quit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top