•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 391,572 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,864 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 269 | Replies: 2
![]() |
•
•
Join Date: Apr 2008
Posts: 16
Reputation:
Rep Power: 1
Solved Threads: 0
Hi,
I m inserting Record in Access using VB6 SQL statement as follows
But this statement does not allows me Leave Blank Text boxes means
it does not allows me to insert NULL value
if i leave any textbox BLANK it generate ERROR -2147217900
HOW to solve this Problem, In my project it is not necessary to insert all records.
when we leave blank Text box it genrate Error
So PLEASE send me code or IDEA to solve this problem
Thanks for Reading My Question
I m inserting Record in Access using VB6 SQL statement as follows
Dim str As String
On Error GoTo solve
str = "INSERT INTO [compinfo]([cID],[cname],[address],[add2],[city],[Postno],[mob],[phno],[faxno],[email],[workday],[offtime],[saldate],[duedate],[amount],[paytyp],[web],[type],[expdat],[charge]) values (" & "'" & txtcomid.Text & "'" & _
"," & "'" & txtcomnam.Text & "'" & "," & "'" & txtcomadd.Text & "'" & "," & "'" & txtcomadd2.Text & "'" & _
"," & "'" & txtcity.Text & "'" & _
"," & txtposton.Text & _
"," & "'" & txtmob.Text & "'" & _
"," & "'" & txtphone.Text & "'" & _
"," & txtfax.Text & _
"," & "'" & txtemail.Text & "'" & "," & "'" & Comwday.Text & "'" & _
"," & "'" & txtofftim.Text & "'" & _
"," & Comsaldat.Text & _
"," & "'" & DTPpay.Value & "'" & _
"," & Txtamount.Text & _
"," & "'" & Compaytyp.Text & "'" & _
"," & "'" & txtwebadd.Text & "'" & _
"," & "'" & Comtype.Text & "'" & _
"," & "#" & expdat.Value & "#" & _
"," & "'" & Comchar.Text & "'" & ")"
con.Execute str
solve:
If Err.Number = -2147217900 Then
MsgBox "Enter All the Fields...", vbCritical
On Error GoTo solve
Else
MsgBox "Your Record Has Been Addedd Successfully . . . ", vbInformation
End IfBut this statement does not allows me Leave Blank Text boxes means
it does not allows me to insert NULL value
if i leave any textbox BLANK it generate ERROR -2147217900
HOW to solve this Problem, In my project it is not necessary to insert all records.
when we leave blank Text box it genrate Error
So PLEASE send me code or IDEA to solve this problem
Thanks for Reading My Question
Last edited by hell_tej : 32 Days Ago at 1:43 pm. Reason: Code tags
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
- Previous Thread: Problem in Trim command
- Next Thread: crystal report and data report



Linear Mode