VB与SQL语句
机房收费系统差不多快做完了,在vb中建立sql语句让我着实头疼了不少时日,因为没有真正理解,所以致使自己焦头烂额。也只有经历过了才有收获。这是一个零碎的知识点,细节的东西也是很重要的。还是把代码贴出来,这样一看就明白了 txtSQL1 = "select * from student_Info where " & fieldName1 & "" & Trim(cboFu1.Text) & " " & " '" & Trim(txtContent1.Text) & "'" txtSQL2 = fieldName2 & Trim(cboFu2.Text) & " '" & Trim(txtContent2.Text) & "'" txtSQLA = "select * from ReCharge_Info where date='" & Cdaytime & "'and time='" & nowTime & "'" txtSQL = "select * from ReCharge_Info where date between ' " & Format(cboStartDate.Text,"yyyy-MM-dd") & "'" & "And " & " '" & Format(cboEndDate.Text,"yyyy-MM-dd") & "'" (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |