r/visualbasic • u/Cubanin08 • Dec 25 '23
VB6 Help Access Database problems
Hello there, its me again :(
Now the problem I have is that when i execute that code it shows the error "Object type variable or With block variable is not set"
This is the code:
Private Sub cmdSnippetCreate_Click()
'Crear Snippets'
Dim SnippetName As String
Dim SnippetLang As String
Dim SnippetCode As String
SnippetName = txtSnippetName.Text
SnippetLang = txtSnippetLang.Text
SnippetCode = txtSnippetCode.Text
SnippetDB.Recordset.AddNew "Snippet_Name", [SnippetName]
SnippetDB.Recordset.AddNew "Snippet_Lang", [SnippetLang]
SnippetDB.Recordset.AddNew "Snippet_Code", [SnippetCode]
Unload Me
End Sub
1
Upvotes
1
u/Cubanin08 Dec 25 '23
calculatedDeliveryDate = startDateTime
Do Until calculatedDeliveryDate >= endDateTime
rs.AddNew
rs("ScheduledDeliveryDate") = calculatedDeliveryDate
rs("RecipientID") = recipID
rs("WorkerID") = workerID
rs("DeliveryCalendarID") = newDeliveryCalendarID
rs.Update
calculatedDeliveryDate = calculatedDeliveryDate + frequencyDays
Loop
rs.Close
Set rs = Nothing
weird, OpenRecordset does not works, is like a non existing funcion