VB与SQL2005的一些操作

前端之家收集整理的这篇文章主要介绍了VB与SQL2005的一些操作前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

PrivateSubAddInfra()

WithAdodc1

.RecordSource="select*fromt_Infra_red"
.Recordset.AddNew
.Recordset.Fields("Device_id")=2
.Recordset.Fields("Dtime")=Date+Time
.Recordset.Fields("Infra")=infra

.Recordset.Update
EndWith

EndSub
PrivateSubAddAlc()


WithAdodc2

.RecordSource="select*fromt_Alcohol"
.Recordset.AddNew
.Recordset.Fields("Device_id")=3
.Recordset.Fields("Dtime")=Date+Time
.Recordset.Fields("Alcohol")=alc

.Recordset.Update
EndWith

EndSub
PrivateSubAddPho()
WithAdodc3

.RecordSource="select*fromt_Photosensitive"
.Recordset.AddNew
.Recordset.Fields("Device_id")=4
.Recordset.Fields("Dtime")=Date+Time
.Recordset.Fields("Photosensitive")=pho

.Recordset.Update
EndWith

EndSub

PrivateSubAddTH()
WithAdodc4

.RecordSource="select*fromt_TemHum"
.Recordset.AddNew
.Recordset.Fields("Device_id")=5
.Recordset.Fields("Dtime")=Date+Time
.Recordset.Fields("Temperature")=tem
.Recordset.Fields("Humidity")=hum
.Recordset.Update
EndWith

EndSub
PrivateSubAddUlt()


WithAdodc5

.RecordSource="select*fromt_Ultrasonic_wave"
.Recordset.AddNew
.Recordset.Fields("Device_id")=6
.Recordset.Fields("Dtime")=Date+Time
.Recordset.Fields("Ultrasonic")=ult

.Recordset.Update
EndWith

EndSub

Ifinfra<>""ThenCallPicture2_ClickElseIfalc<>""ThenCallPicture3_ClickElseIfpho<>""ThenCallPicture4_ClickElseIfth<>""ThenCallPicture5_ClickElseIfult<>""ThenCallPicture6_ClickEndIf

原文链接:https://www.f2er.com/vb/258915.html

猜你在找的VB相关文章