Visual Fox With SQL Server

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

8

1
xvii

FetchMemo 71
Tables 72
Field properties 72
DefaultValue 72
RuleExpression 73
UpdateName 73
DataType 73
Summary 74

Chapter 5: Upsizing: Moving from File-Server to Client/Server 75


Why upsize? 75
Using the SQL Server Upsizing Wizard 76
Indexes 81
Defaults 82
Relationships 84
Validation rules 85
Changes made locally 86
Finished at last? Modifying the results of the Upsizing Wizard 87
The local database 88
Summary 93

Chapter 6: Extending Remote Views with SQL Pass Through 95


Connecting to the server 95
The SQLConnect() function 96
The SQLStringConnect() function 96
Handling connection errors 97
Disconnecting 98
Accessing metadata 98
The SQLTables() function 99
The SQLColumns() function 100
Submitting queries 101
Queries that return a result set 101
Retrieving multiple result sets 102
Queries that modify data 105
Parameterized queries 105
Making SQL pass through result sets updatable 108
Calling stored procedures 109
Handling input and output parameters 109
Transaction management 111
Binding connections 113
Asynchronous processing 113
Connection properties revisited 115
Other connection properties 116
xiii

List of Chapters
Chapter 1: Introduction to Client/Server 1
Chapter 2: Visual FoxPro for Client/Server Development 19
Chapter 3: Introduction to SQL Server 7.0 27
Chapter 4: Remote Views 57
Chapter 5: Upsizing: Moving from File-Server to Client/Server 75
Chapter 6: Extending Remote Views with SQL Pass Through 95
Chapter 7: Downsizing 125
Chapter 8: Errors and Debugging 145
Chapter 9: Some Design Issues for C/S Systems 159
Chapter 10: Application Distribution and Managing Updates 177
Chapter 11: Transactions 193
Chapter 12: ActiveX Data Objects 209
Appendix A: New Features of SQL Server 2000 225
8

1
xvii

FetchMemo 71
Tables 72
Field properties 72
DefaultValue 72
RuleExpression 73
UpdateName 73
DataType 73
Summary 74

Chapter 5: Upsizing: Moving from File-Server to Client/Server 75


Why upsize? 75
Using the SQL Server Upsizing Wizard 76
Indexes 81
Defaults 82
Relationships 84
Validation rules 85
Changes made locally 86
Finished at last? Modifying the results of the Upsizing Wizard 87
The local database 88
Summary 93

Chapter 6: Extending Remote Views with SQL Pass Through 95


Connecting to the server 95
The SQLConnect() function 96
The SQLStringConnect() function 96
Handling connection errors 97
Disconnecting 98
Accessing metadata 98
The SQLTables() function 99
The SQLColumns() function 100
Submitting queries 101
Queries that return a result set 101
Retrieving multiple result sets 102
Queries that modify data 105
Parameterized queries 105
Making SQL pass through result sets updatable 108
Calling stored procedures 109
Handling input and output parameters 109
Transaction management 111
Binding connections 113
Asynchronous processing 113
Connection properties revisited 115
Other connection properties 116
xviii

Remote views vs. SQL pass through 118


SQL pass through 118
Remote views 119
Using remote views and SPT together 122
Transactions 122
Stored procedures 122
Filter conditions 123
Summary 123

Chapter 7: Downsizing 125


The case for a single code base 125
Interchangeable back ends 125
Remote views of VFP data 126
Substituting local views for remote views 128
Abstracting data access functionality 130
Microsoft Data Engine (MSDE) 136
What is MSDE? 136
MSDE vs. SQL Server 137
Distributing MSDE applications 141
Migrating MSDE databases to SQL Server 142
Summary 144

Chapter 8: Errors and Debugging 145


Handling errors 145
Trapping errors 145
Reporting errors 146
Conflict resolution 150
View errors 151
Debugging tools 152
SQL Server Profiler 152
The SQL Server Performance Monitor 155
ODBC logs 156
Summary 158

Chapter 9: Some Design Issues for C/S Systems 159


SQL database design issues 159
Data integrity mechanisms 160
VFP developer vs. SQL Server DBA 168
Client/server performance issues 169
Choosing indexes 169
Client/server division of work 171
Data location 173
Security 173
Client application 173
xix

SQL Server logins and permissions 174


Application roles 174
Summary 175

Chapter 10: Application Distribution and Managing Updates 177


Client/server development 177
Development environment 177
Deployment models 179
Traditional 179
Components 180
Server 180
Distributing databases (creating) 181
Existence of SQL Server 181
SQL pass through 182
SQL scripts 183
SQL-DMO 184
Object transfer (DTS) 185
Backup/restore 186
sp_Detach_DB and sp_Attach_DB 186
Managing updates 187
Application changes 187
Database updates 189
Version control coordination between client and server 191
Local lookup data 191
Why 192
Managing updates 192
Summary 192

Chapter 11: Transactions 193


Transaction basics 193
ACID properties 193
Visual FoxPro transactions 194
The missing property 195
SQL Server transactions 196
Implicit transactions 196
SQL Server isolation levels 198
Durable transactions 200
Locking 202
Lock compatibility 203
Blocking 203
Viewing lock activity 204
Deadlocks 207
Transaction gotcha! 208
Summary 208
xx

Chapter 12: ActiveX Data Objects 209


Why ADO? 209
ADO benefits 209
ADO disadvantages 211
Installing and distributing ADO 211
Using ADO within Visual FoxPro 212
The Connection object 212
The RecordSet object 214
The Command object 221
Summary 224

Appendix A: New Features of SQL Server 2000 225


Feature list 225
Installation issues 227
Query Analyzer 227
Debugging stored procedures 228
User-defined functions 229
Referential integrity 231
Trigger enhancements 232
Indexing computed columns 233
New data types 234
Big integers 234
Variants 234
Tables as variables 235
Summary 236
Client/Server Applications with Visual FoxPro and SQL Server

You might also like