p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Access 2003 VBA Programmer's Reference (http://p2p.wrox.com/forumdisplay.php?f=133)
-   -   Chapter 17 - Using Unbound forms question (http://p2p.wrox.com/showthread.php?t=17072)

Arcadi August 18th, 2004 03:52 PM

Chapter 17 - Using Unbound forms question
I've been reviewing the code on the frmShippers form for connecting an unbound form to an SQL recordset using ADO.

I've noticed that nowhere in the code are you closing the recordset or setting it to nothing. Again same with the connection. My understanding is that if you don't close the recordset and connection and set them to nothing, that you run the risk of corruption. Is there something different in the sample database that I'm not seeing, that keeps that from occuring?

I'm looking to use code similar to that in Chapter 17 pages 566 - 572. I'm not setting up a connection for the entire database like the sample database that I downloaded from the web site. For my example I'm connecting to the Northwind Database from within the form, so in my Form_Open sub, my connection string looks like this:

cnTest.ConnectionString = "driver={SQL Server};uid=sa;pwd=Password;server=TIMESLIP; database=Northwind"

Everything else is the same as the book, does this make a difference?

"The older you get
the more you know about yourself and what you want,
the less you let things upset you."
 - Lost in Translation

All times are GMT -4. The time now is 12:36 PM.

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