Presentation is loading. Please wait.

Presentation is loading. Please wait.

Pocket Access.

Similar presentations


Presentation on theme: "Pocket Access."— Presentation transcript:

1 Pocket Access

2 Pocket Access Access 2000的縮小版
PDA裡面預設有,但是看不到,只看到Pocket Word, Pocket Excel 不提供報表與巨集 副檔名是cdb(Access 2000是mdb) 利用Active Sync進行轉換

3 MDB  CDB

4 MDB  CDB PDA與PC要先建立連線

5 MDB  CDB 選擇與PC同步

6 MDB  CDB 將Pocket Access打勾

7 MDB  CDB

8 MDB  CDB

9 MDB  CDB 如果連線選定[來賓合作關係]將不會有此選項

10 MDB  CDB 選擇PC上的MDB檔案,準備轉入PDA

11 MDB  CDB

12 MDB  CDB 轉換傳送完成

13 CDB  MDB

14 CDB  MDB

15 CDB  MDB

16 CDB  MDB

17 CDB  MDB

18 ADOCE 3.1 MS Activex Dtat Objects for Windows CE

19 ADOCE Connection  資料庫 Recordset  資料表 Field  欄位 Error  錯誤處理 四個物件
選擇Project  References 引用ADOCE

20 ADOCE 選擇Project  References 引用ADOCE

21 ADOCE 選擇MS CE ADO Control 3.1

22 ADOCE

23 ADOCE

24 ADOCE 結束指令

25 ADOCE 如果ADOCE引用正確,會看到ADOCE選項

26 ADOCE ' 建立connection物件 Dim conn As ADOCE.Connection
Set conn = CreateObject("ADOCE.Connection.3.1") '建立recordset物件 Dim rs As ADOCE.Recordset Set rs = CreateObject("ADOCE.Recordset.3.1")

27 ADOCE 建立connection物件 連接DB 建立recordset物件 連接資料表 顯示資料 關閉資料庫連線

28 ADOCE 使用FILESYSTEM物件 Project  Components  MS CE Filesystem Control 3.0 Private Function DBEXISTS(strfilename As String) As Boolean If FileSystem1.Dir(strfilename) <> "" Then DBEXISTS = True Else DBEXISTS = False End If End Function

29 ADOCE ' 設定資料庫路徑 Dim strpath, dbfilename As String strpath = App.Path
If strpath = "\" Then strpath = "" End If dbfilename = strpath & "\test.cdb" If DBEXISTS(dbfilename) = True Then

30 ADOCE ' 建立connection物件 Dim conn As ADOCE.Connection
Set conn = CreateObject("ADOCE.Connection.3.1") ' 開啟資料庫 conn.Open dbfilename If conn.Errors.Count > 0 Then MsgBox "資料庫開啟錯誤" End If '建立recordset物件 Dim rs As ADOCE.Recordset Set rs = CreateObject("ADOCE.Recordset.3.1") ' 連接資料表 rs.Open "select * from member", conn, adOpenDynamic, adLockReadOnly

31 ADOCE ' 顯示資料 Text1.Text = rs("name") Text2.Text = rs("birthday")
Text3.Text = rs("memo") '關閉資料庫 conn.Close Set rs = Nothing Set conn = Nothing

32 ADOCE 沒有安裝msvbppc.armv4.cab

33 ADOCE

34 新/刪/修/查

35 新增 rs.AddNew rs("name") = Text1.Text rs("birthday") = Text2.Text
rs.Update

36 刪除/修改 ‘ 刪除 rs.Delete ‘ 修改 rs("name") = Text1.Text
rs("birthday") = Text2.Text rs.Update

37 上下筆 ‘ 下一筆 rs.MoveNext If rs.EOF Then rs.MoveFirst End If ‘ 上一筆
rs.MovePrevious If rs.BOF Then rs.MoveLast End If

38 首末筆 ‘ 首筆 rs.MoveFirst ‘ 末筆 rs.MoveLast

39 使用Grid來顯示資料 GridCtrl1.Rows = totalcount + 1 GridCtrl1.Cols = 2
GridCtrl1.Text = "姓名" GridCtrl1.Col = 1 GridCtrl1.Text = "生日" rs.MoveFirst For i = 1 To totalcount GridCtrl1.Row = i For j = 0 To 1 GridCtrl1.Col = j Select Case j Case 0: GridCtrl1.Text = rs("name") Case 1: GridCtrl1.Text = rs("birthday") End Select Next rs.MoveNext


Download ppt "Pocket Access."

Similar presentations


Ads by Google