Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
| Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 2nd, 2006, 05:39 AM
Registered User
 
Join Date: Nov 2004
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connect SQL Server 2000 with VB6

Hi there,

I have a VB6 program connected to Access 97. I migrated access 97 into SQL server 2000 and i am now in the process of linking SQL server 2000 database with VB6. I used the connection string and it seems to be working.

My problem is VB6 code uses opentable method to open access 97 tables. This has been used in many times in the code and i need to know how i can use the same code to SQL server 2000.
For example, at present it uses

Set MyTable1 = MyDb.OpenTable("client") for Access 97. How can i do the same for SQL server 2000?

I am very new to SQL server and i really appriciate u r help!

Thank you very much...


 
Old May 8th, 2006, 02:01 PM
Authorized User
 
Join Date: May 2006
Location: Bangalore, , India.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to manudutt
Default

you need a lot of changes .. if you want to open a table and then use it you can use (in ADODB connection) -
Code:
Dim rec_item As New adodb.Recordset
...
rec_item.open ("SELECT * FROM item_main "), _
 connect, adOpenDynamic, adLockOptimistic
here connect is ADOBB connection.

if you want to update , delete any thing from table you can directly use SQL queries for that ,like
Code:
db.Execute "UPDATE item_main SET item_quan = item_quan   _
+ " & added_item & " WHERE item_no = " & cur_ino
you can ,however, use -
Code:
recordsetname.Add
recordsetname.Update
if you are using recordset ..
(NOTE : _ (underscore) is used to change line in VB)






Similar Threads
Thread Thread Starter Forum Replies Last Post
CAN NOT CONNECT TO SQL SERVER 2000 REMOTELY charlietritran SQL Server 2000 9 December 22nd, 2006 04:14 PM
Connect to SQL server 2000 from home! Jane SQL Server 2000 5 June 7th, 2006 03:42 PM
Connect SQL Server 2000 table with VB6 sanjna000 Access 1 May 2nd, 2006 06:28 AM
Access 2000 "Connect to SQL Server" cjdphlx Access VBA 1 July 17th, 2005 02:09 AM
SQL Server connect to VB6 okinokiyo SQL Server 2000 3 June 7th, 2004 11:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.