📄 数据转换.frm
字号:
VERSION 5.00
Begin VB.Form frmInfomation
Caption = "Form1"
ClientHeight = 8535
ClientLeft = 60
ClientTop = 450
ClientWidth = 12435
LinkTopic = "Form1"
ScaleHeight = 8535
ScaleWidth = 12435
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command3
Caption = "数据库--->>"
Height = 615
Left = 9240
TabIndex = 33
Top = 6720
Width = 1695
End
Begin VB.CommandButton Command2
Caption = "----->>数据库"
Height = 855
Left = 9240
TabIndex = 32
Top = 5280
Width = 1455
End
Begin VB.CommandButton Command1
Caption = "批处理"
Height = 975
Left = 9120
TabIndex = 31
Top = 3960
Width = 1335
End
Begin VB.TextBox Text17
Height = 735
Left = 8880
TabIndex = 30
Text = "Text17"
Top = 2880
Width = 2295
End
Begin VB.TextBox Text16
Height = 615
Left = 10800
TabIndex = 29
Text = "Text16"
Top = 1440
Width = 735
End
Begin VB.TextBox Text15
Height = 735
Left = 8400
TabIndex = 28
Text = "Text15"
Top = 1320
Width = 1455
End
Begin VB.TextBox Text1
Height = 495
Left = 480
TabIndex = 13
Text = "Text1"
Top = 720
Width = 3255
End
Begin VB.TextBox Text2
Height = 495
Left = 480
TabIndex = 12
Text = "Text2"
Top = 1920
Width = 3255
End
Begin VB.TextBox Text3
Height = 495
Left = 480
TabIndex = 11
Text = "Text3"
Top = 2880
Width = 3255
End
Begin VB.TextBox Text4
Height = 495
Left = 360
TabIndex = 10
Text = "Text4"
Top = 4080
Width = 3255
End
Begin VB.TextBox Text5
Height = 495
Left = 480
TabIndex = 9
Text = "Text5"
Top = 5280
Width = 3255
End
Begin VB.TextBox Text6
Height = 495
Left = 480
TabIndex = 8
Text = "Text6"
Top = 6360
Width = 3255
End
Begin VB.TextBox Text7
Height = 495
Left = 600
TabIndex = 7
Text = "Text7"
Top = 7680
Width = 3255
End
Begin VB.TextBox Text8
Height = 495
Left = 4200
TabIndex = 6
Text = "Text8"
Top = 720
Width = 3255
End
Begin VB.TextBox Text9
Height = 495
Left = 4200
TabIndex = 5
Text = "Text9"
Top = 1800
Width = 3255
End
Begin VB.TextBox Text10
Height = 495
Left = 4320
TabIndex = 4
Text = "Text10"
Top = 3000
Width = 3255
End
Begin VB.TextBox Text11
Height = 495
Left = 4560
TabIndex = 3
Text = "Text11"
Top = 4200
Width = 3255
End
Begin VB.TextBox Text12
Height = 495
Left = 4560
TabIndex = 2
Text = "Text12"
Top = 5400
Width = 3255
End
Begin VB.TextBox Text13
Height = 495
Left = 4560
TabIndex = 1
Text = "Text13"
Top = 6480
Width = 3255
End
Begin VB.TextBox Text14
Height = 495
Left = 4560
TabIndex = 0
Text = "Text14"
Top = 7680
Width = 3255
End
Begin VB.Label Label14
Caption = "Label14"
Height = 255
Left = 4680
TabIndex = 27
Top = 7200
Width = 3255
End
Begin VB.Label Label13
Caption = "Label13"
Height = 255
Left = 4680
TabIndex = 26
Top = 5880
Width = 3255
End
Begin VB.Label Label12
Caption = "Label12"
Height = 255
Left = 4560
TabIndex = 25
Top = 4800
Width = 3255
End
Begin VB.Label Label11
Caption = "Label11"
Height = 255
Left = 4680
TabIndex = 24
Top = 3600
Width = 3255
End
Begin VB.Label Label10
Caption = "Label10"
Height = 255
Left = 4560
TabIndex = 23
Top = 2400
Width = 3255
End
Begin VB.Label Label9
Caption = "Label9"
Height = 255
Left = 4920
TabIndex = 22
Top = 1440
Width = 3255
End
Begin VB.Label Label8
Caption = "Label8"
Height = 255
Left = 4920
TabIndex = 21
Top = 120
Width = 3255
End
Begin VB.Label Label7
Caption = "Label7"
Height = 255
Left = 720
TabIndex = 20
Top = 7200
Width = 3255
End
Begin VB.Label Label6
Caption = "Label6"
Height = 255
Left = 720
TabIndex = 19
Top = 5880
Width = 3255
End
Begin VB.Label Label5
Caption = "Label5"
Height = 255
Left = 480
TabIndex = 18
Top = 4800
Width = 3255
End
Begin VB.Label Label4
Caption = "Label4"
Height = 255
Left = 600
TabIndex = 17
Top = 3600
Width = 3255
End
Begin VB.Label Label3
Caption = "Label3"
Height = 255
Left = 480
TabIndex = 16
Top = 2520
Width = 3255
End
Begin VB.Label Label2
Caption = "Label2"
Height = 255
Left = 480
TabIndex = 15
Top = 1440
Width = 3255
End
Begin VB.Label Label1
Caption = "Label1"
Height = 255
Left = 600
TabIndex = 14
Top = 240
Width = 3255
End
End
Attribute VB_Name = "frmInfomation"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim j As Integer
Dim i As Integer
Dim a As String
Private Const ConStr = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source="
Private Sub Command1_Click()
Dim str As String
a = Text17.Text
For i = Text15.Text To Text16.Text
'str = str & i
Command3_Click
Command2_Click
Next
End Sub
Private Sub Command2_Click()
Dim adors As New ADODB.Recordset
Dim ttt As New ADODB.Connection
Dim instrq As String
On Error Resume Next
a = Text17.Text
instrq = "select * from " & a
Set ttt = New ADODB.Connection
Dim ccc As String
ccc = "E:\slq_map"
If Len(ccc) > 3 Then ccc = ccc + "\"
ccc = ConStr + ccc + "淮安旅游.mdb"
With ttt
.CommandTimeout = 500
.ConnectionString = ccc
.CursorLocation = adUseClient
.Open
End With
adors.Open instrq, ttt, adOpenDynamic, adLockPessimistic
adors.AddNew
adors!id = Text1.Text
adors!景点名称 = Text2.Text
adors!景点介绍 = Text10.Text
adors!经度 = Text5.Text
adors!纬度 = Text6.Text
adors!主管单位 = Text3.Text
adors!行政区位 = Text4.Text
adors!特征数据 = Text11.Text
adors!景系 = Text7.Text
adors!景类 = Text8.Text
adors!景型 = Text9.Text
adors!历史与自然环境背景 = Text12.Text
adors!保护与开发现状 = Text13.Text
adors.Update
adors.Close
ttt.Close
End Sub
Private Sub Command3_Click()
Dim adors As New ADODB.Recordset
Dim ttt As New ADODB.Connection
Dim strid As String
On Error Resume Next
Text1.Text = "缺少数据"
Text2.Text = "缺少数据"
Text3.Text = "缺少数据"
Text4.Text = "缺少数据"
Text5.Text = "缺少数据"
Text6.Text = "缺少数据"
Text7.Text = "缺少数据"
Text8.Text = "缺少数据"
Text9.Text = "缺少数据"
Text10.Text = "缺少数据"
Text11.Text = "缺少数据"
Text12.Text = "缺少数据"
Text13.Text = "缺少数据"
Text14.Text = "缺少数据"
Set ttt = New ADODB.Connection
Dim ccc As String
ccc = "E:\slq_map"
If Len(ccc) > 3 Then ccc = ccc + "\"
ccc = ConStr + ccc + "淮安旅游.mdb"
With ttt
.CommandTimeout = 500
.ConnectionString = ccc
.CursorLocation = adUseClient
.Open
End With
If ttt.State = adStateOpen Then
'MsgBox "success"
End If
adors.Open "select * from " & i, ttt, adOpenForwardOnly, adLockReadOnly
adors.MoveFirst
Text1.Text = adors.Fields(13).Value ' 序号
adors.MoveNext
Text2.Text = adors.Fields(2).Value '名称
adors.MoveNext
Text3.Text = adors.Fields(2).Value '主管单位
adors.MoveNext
Text4.Text = adors.Fields(2).Value '行政区
adors.MoveNext
Text5.Text = adors.Fields(2).Value '经度
Text6.Text = adors.Fields(7).Value '纬度
adors.MoveNext
adors.MoveNext
Text7.Text = adors.Fields(2).Value '景系
Text8.Text = adors.Fields(5).Value '景类
Text9.Text = adors.Fields(7).Value '景型
adors.MoveNext
Text10.Text = adors.Fields(1).Value '景点介绍
adors.MoveNext
adors.MoveNext
Text11.Text = adors.Fields(1).Value '特征数据
adors.MoveNext
adors.MoveNext
adors.MoveNext
adors.MoveNext
adors.MoveNext
adors.MoveNext
adors.MoveNext
adors.MoveNext
Text12.Text = adors.Fields(1).Value '历史与自然环境背景
adors.MoveNext
adors.MoveNext
adors.MoveNext
Text13.Text = adors.Fields(1).Value '定级、保护与开发现状
adors.Close
ttt.Close
End Sub
Private Sub Form_Load()
'Text1.Text = Text2.Text = Text3.Text = Text4.Text = Text5.Text = Text6.Text = Text7.Text = Text8.Text = Text9.Text = Text10.Text = Text11.Text = "缺少数据"
'Text12.Text = Text13.Text = Text14.Text = "缺少数据"
Text1.Text = "缺少数据"
Text2.Text = "缺少数据"
Text3.Text = "缺少数据"
Text4.Text = "缺少数据"
Text5.Text = "缺少数据"
Text6.Text = "缺少数据"
Text7.Text = "缺少数据"
Text8.Text = "缺少数据"
Text9.Text = "缺少数据"
Text10.Text = "缺少数据"
Text11.Text = "缺少数据"
Text12.Text = "缺少数据"
Text13.Text = "缺少数据"
Text14.Text = "缺少数据"
Text15.Text = 0
Text16.Text = 0
Text17.Text = "travel"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -