-
Notifications
You must be signed in to change notification settings - Fork 0
/
Database.cs
376 lines (305 loc) · 8.58 KB
/
Database.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
using System;
namespace Free.Database.Dao.Net
{
public class Database
{
internal DAO.Database db;
public Database(DAO.Database _db)
{
db=_db;
}
[Obsolete("Use OpenRecordset instead.", false)]
public Recordset _30_OpenRecordset(string source)
{
return new Recordset(db._30_OpenRecordset(source, Type.Missing, Type.Missing));
}
[Obsolete("Use OpenRecordset instead.", false)]
public Recordset _30_OpenRecordset(string source, RecordsetType type)
{
return new Recordset(db._30_OpenRecordset(source, type, Type.Missing));
}
[Obsolete("Use OpenRecordset instead.", false)]
public Recordset _30_OpenRecordset(string source, RecordsetType type, RecordsetOption options)
{
return new Recordset(db._30_OpenRecordset(source, type, options));
}
public void BeginTrans()
{
db.BeginTrans();
}
public void Close()
{
db.Close();
}
public void CommitTrans()
{
db.CommitTrans(0);
}
public void CommitTrans(CommitTransOptions option)
{
db.CommitTrans((int)option);
}
[Obsolete("Use OpenRecordset instead.", false)]
public Recordset CreateDynaset(string source, RecordsetOption options, bool inconsistent)
{
return new Recordset(db.CreateDynaset(source, options, inconsistent));
}
public Property CreateProperty()
{
return new Property(db.CreateProperty(Type.Missing, Type.Missing, Type.Missing, Type.Missing));
}
public Property CreateProperty(string name)
{
return new Property(db.CreateProperty(name, Type.Missing, Type.Missing, Type.Missing));
}
public Property CreateProperty(string name, DataType type)
{
return new Property(db.CreateProperty(name, type, Type.Missing, Type.Missing));
}
public Property CreateProperty(string name, DataType type, object val)
{
return new Property(db.CreateProperty(name, type, val, Type.Missing));
}
public Property CreateProperty(string name, DataType type, object val, bool ddl)
{
return new Property(db.CreateProperty(name, type, val, ddl));
}
public QueryDef CreateQueryDef()
{
return new QueryDef(db.CreateQueryDef(Type.Missing, Type.Missing));
}
public QueryDef CreateQueryDef(string name)
{
return new QueryDef(db.CreateQueryDef(name, Type.Missing));
}
public QueryDef CreateQueryDef(string name, string sqltext)
{
return new QueryDef(db.CreateQueryDef(name, sqltext));
}
public Relation CreateRelation()
{
return new Relation(db.CreateRelation(Type.Missing, Type.Missing, Type.Missing, Type.Missing));
}
public Relation CreateRelation(string name)
{
return new Relation(db.CreateRelation(name, Type.Missing, Type.Missing, Type.Missing));
}
public Relation CreateRelation(string name, string table)
{
return new Relation(db.CreateRelation(name, table, Type.Missing, Type.Missing));
}
public Relation CreateRelation(string name, string table, string foreigntable)
{
return new Relation(db.CreateRelation(name, table, foreigntable, Type.Missing));
}
public Relation CreateRelation(string name, string table, string foreigntable, RelationAttribute attributes)
{
return new Relation(db.CreateRelation(name, table, foreigntable, attributes));
}
[Obsolete("Use OpenRecordset instead.", false)]
public Recordset CreateSnapshot(string source, RecordsetOption options)
{
return new Recordset(db.CreateSnapshot(source, options));
}
public TableDef CreateTableDef()
{
return new TableDef(db.CreateTableDef(Type.Missing, Type.Missing, Type.Missing, Type.Missing));
}
public TableDef CreateTableDef(string name)
{
return new TableDef(db.CreateTableDef(name, Type.Missing, Type.Missing, Type.Missing));
}
public TableDef CreateTableDef(string name, TableDefAttribute attributes)
{
return new TableDef(db.CreateTableDef(name, attributes, Type.Missing, Type.Missing));
}
public TableDef CreateTableDef(string name, TableDefAttribute attributes, string source)
{
return new TableDef(db.CreateTableDef(name, attributes, source, Type.Missing));
}
public TableDef CreateTableDef(string name, TableDefAttribute attributes, string source, string connect)
{
return new TableDef(db.CreateTableDef(name, attributes, source, connect));
}
[Obsolete("Use QueryDefs.Delete instead.", false)]
public void DeleteQueryDef(string name)
{
db.DeleteQueryDef(name);
}
public void Execute(string source)
{
db.Execute(source, Type.Missing);
}
public void Execute(string source, RecordsetOption options)
{
db.Execute(source, options);
}
public int ExecuteSQL(string sqltext)
{
return db.ExecuteSQL(sqltext);
}
[Obsolete("Use e.g. Tabledefs[name].Fields instead.", false)]
public Recordset ListFields(string name)
{
return new Recordset(db.ListFields(name));
}
[Obsolete("Use Tabledefs instead.", false)]
public Recordset ListTables()
{
return new Recordset(db.ListTables());
}
public void MakeReplica(string name, string description, ReplicaType options)
{
db.MakeReplica(name, description, options);
}
public void NewPassword(string oldpwd, string newpwd)
{
db.NewPassword(oldpwd, newpwd);
}
[Obsolete("Use QueryDefs instead.", false)]
public QueryDef OpenQueryDef(string name)
{
return new QueryDef(db.OpenQueryDef(name));
}
public Recordset OpenRecordset(string source)
{
return new Recordset(db.OpenRecordset(source, Type.Missing, Type.Missing, Type.Missing));
}
public Recordset OpenRecordset(string source, RecordsetType type)
{
return new Recordset(db.OpenRecordset(source, type, Type.Missing, Type.Missing));
}
public Recordset OpenRecordset(string source, RecordsetType type, RecordsetOption options)
{
return new Recordset(db.OpenRecordset(source, type, options, Type.Missing));
}
public Recordset OpenRecordset(string source, RecordsetType type, RecordsetOption options, LockType lockedits)
{
return new Recordset(db.OpenRecordset(source, type, options, lockedits));
}
[Obsolete("Use OpenRecordset instead.", false)]
public Recordset OpenTable(string name, RecordsetOption options)
{
return new Recordset(db.OpenTable(name, options));
}
public void PopulatePartial(string dbname)
{
db.PopulatePartial(dbname);
}
public void Rollback()
{
db.Rollback();
}
public void Synchronize(string dbname, SynchronizeType exchange)
{
db.Synchronize(dbname, exchange);
}
public CollatingOrder CollatingOrder
{
get { return (CollatingOrder)db.CollatingOrder; }
}
public string Connect
{
get { return db.Connect; }
set { db.Connect=value; }
}
public Connection Connection
{
get { return new Connection(db.Connection); }
}
public Containers Containers
{
get { return new Containers(db.Containers); }
}
public string DesignMasterID
{
get { return db.DesignMasterID; }
set { db.DesignMasterID=value; }
}
public string Name
{
get { return db.Name; }
}
public Properties Properties
{
get { return new Properties(db.Properties); }
}
public QueryDefs QueryDefs
{
get { return new QueryDefs(db.QueryDefs); }
}
public short QueryTimeout
{
get { return db.QueryTimeout; }
set { db.QueryTimeout=value; }
}
public int RecordsAffected
{
get { return db.RecordsAffected; }
}
public Recordsets Recordsets
{
get { return new Recordsets(db.Recordsets); }
}
public Relations Relations
{
get { return new Relations(db.Relations); }
}
public string ReplicaID
{
get { return db.ReplicaID; }
}
public TableDefs TableDefs
{
get{ return new TableDefs(db.TableDefs); }
}
public bool Transactions
{
get { return db.Transactions; }
}
public bool Updatable
{
get { return db.Updatable; }
}
public string Version
{
get { return db.Version; }
}
}
class DatabasesEnumerator : System.Collections.IEnumerator
{
internal System.Collections.IEnumerator Enmtr;
public DatabasesEnumerator(System.Collections.IEnumerator _Enmtr) { Enmtr=_Enmtr; }
public void Reset() { Enmtr.Reset(); }
public bool MoveNext() { return Enmtr.MoveNext(); }
public object Current { get{ return new Database((DAO.Database)Enmtr.Current); } }
}
public class Databases
{
internal DAO.Databases dbs;
public Databases(DAO.Databases _dbs)
{
dbs=_dbs;
}
public short Count
{
get { return dbs.Count; }
}
public System.Collections.IEnumerator GetEnumerator()
{
return new DatabasesEnumerator(dbs.GetEnumerator());
}
public void Refresh()
{
dbs.Refresh();
}
public Database this[string index]
{
get { return new Database(dbs[index]); }
}
public Database this[int index]
{
get { return new Database(dbs[index]); }
}
}
}