VB Error 3421
I keep getting a data conversion error while using vb6 w/access backend. I'm trying to insert a blank or null value into a date field. Can anyone help?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Data Type Conversion Error. (Error 3421)
hi!! last time i had a problem this forum helped me a lot, so i´m here again...
See this:
Form2.Data1.DatabaseName = "passwords.xls"
Form2.Data1.RecordSource = "datos$"
Form2.Data1.Refresh
Form2.Data1.Recordset.AddNew
Form2.Data1.Recordset("Password") = p2.Text
Form2.Data1.Recordset.Update
This code gives me a 3421 error, since "p2.text" seems to have the wrong format... any ideas how i can get to run it...?
>>> thanks in advance
Vb Runtime Error 3421
I am getting the error message "value of the wrong type for the current operation" when a procedure runs which stores a value in a sql table.
The value (an item code) is the same amount of digits (6) as other values in the database. The code fails on the line that puts the value into a temporary parameter
Has anyone any ideas what could be causing this
Get A 3421 Error When Compact A Database
When I use the code "DBEngine.CompactDatabase App.Path & "videorent.mdb", App.Path & " mp.mdb", DbLangGeneral, ";PWD=" & DBPass" to compact a database of ACCESS2000 Format, got a error 3421 "Data Type Conversion Error" . why? Thks a ton.
3421: Data Type Conversion Error
Hi all,
I have database related problem. I make a access database password protected. I am trying to access the database. But I am getting the error,
Run-time error 3421
Data typeconversion error.
Following is my code.
[vb code]
Dim I As Long
Set myset = OpenDatabase(App.Path & "mydata.mdb", "ffshh84151561yuy").OpenRecordset("mytable", dbOpenDynaset)
If myset.RecordCount <> 0 Then
myset.MoveFirst
For I = 0 To myset.RecordCount - 1
display
Next
Else
Clear
End If
[vb code]
Please help me to cope up with the situation.
Suddenly Getting 3421 Error After Installing 2000 SP2
We have code that has been working on all Windows platforms, but comes back with the 3421 (Application uses a value of the wrong type for the current operation) when running on a machine with Win2000 SP2 installed. Does anyone know what causes this and how we might be able to correct it?
3421-Application Uses A Value Of The Wrong Type For The Current Operation.
I get an error when I select more than 15 Customers. But, when I select less than 15 Customers I do not get this error.
ERROR: -> "3421-Application uses a value of the wrong type for the current operation."
The error comes up after it hits the "End Property"
VB Code:
Private mstrCustInNum As String Private mblnAllCust As Boolean Public Property Get CustInNum() As String If mblnAllCust Then CustInNum = "" Else CustInNum = mstrCustInNum End If If mblnOverrideSelection Then CustInNum = mstrCustInNum End IfEnd Property
Also, I ran the Stored Procedure with the same data and it works fine.
Error Msg - "Run-Time Error '-2147417848(80010108)': Automation Error
I have a menu-item which when clicked starts up a browser and goes to the site which the user selected from the appropriate menulist. It works fine in VB6 when I click on the play button, (design time). However, after using the Package & Deployment Wizard, I get the following error message: "Run-Time error '-2147417848(80010108)': Automation Error What in the world is going on. Is it that the browser object is not installing correctly since it works in the VB6 environment? :-( Or is it some code that is creating the problem. I am still new at this, but making great progress. Just ready to get this beta out to some of my testers.
I was under the impression that if you could run the program during the design process without any problems, then you could run it after compiling and packaging with the Deployment Wizard.
email should be on my post,... however it is:
scrocker@midsouth.rr.com
Thanks,
Sal
Problem With Error-handling: First Error Handled, Second Error Breaks
Once again working with my Queue system, I have come across a bit of a strange problem. Right now I have the Queue set up as a loop where it processes all tasks until there are no more tasks remaining. Tasks are in sub-procedures, which are called from inside the loop. I have set up error-handling to be in the procedure with the loop (called PerformTasks). If one of the sub-procedures hits an error, the error-handling is taken care of by the PerformTasks sub.
The error-handling in PerformTasks is simple, it just raises an error event that will show up on a display to the user, then removes the task that caused the error, and then uses a GoTo to jump back in the processing loop. Here is a stripped-down example:
Code:
On Error GoTo PerformTasks_Error
'get the first task in the queue
lngTaskID = GetFirstTaskID
'check to see if there are actually tasks in the queue
While Not lngTaskID = -1
'get the details about this task
Set objTask = GetTaskDetails(lngTaskID)
'now based on the type of operation that must be performed, we do it
Select Case objTask.Task_Type
'do tasks based on select
End Select
'we need to remove the task here now, since otherwise we will loop endlessly
RemoveTask lngTaskID
'get the next task
lngTaskID = GetFirstTaskID
'do reporting at very end so that if there was an error we catch it as an
'error instead of reporting a completed and an error
'report the task completion via the event
RaiseEvent TaskCompleted(objCompletedTask)
'this lets us get back into the loop for continuing the queue after errors
Error_Resume:
Wend
'all of the tasks are complete so raise the all tasks completed event
RaiseEvent AllTasksComplete
Exit Sub
PerformTasks_Error:
'error, so remove task
RemoveTask lngTaskID
'get the next task
lngTaskID = GetFirstTaskID
'raise the error event
RaiseEvent TaskError(objTask)
'resume processing
Err.Clear
GoTo Error_Resume
The problem I'm having is that the error-handling only works for the first error. I have 4 RemoveFile tasks in a row that will all error out for the same reason (it's trying to delete a file that doesn't exist). The first time through, when the error happens, it jumps out of the RemoveFile sub and into my PerformTasks_Error as it should. The second time, however, it breaks with a "File not found" error. This is even though I have error-handling set to "Break on unhandled errors", and this SHOULD be handled - after all, it handles it the first time.
I added the line that says "Err.Clear" because I thought maybe I had to reset the error object after the first error catch...but that didn't help. I feel as though I might be on the right track with that tho, from this in the MSDN help:
Quote:
The Err object's properties are reset to zero or zero-length strings ("") after an Exit Sub, Exit Function, Exit Property or Resume Next statement within an error-handling routine. Using any form of the Resume statement outside of an error-handling routine will not reset the Err object's properties. The Clear method can be used to explicitly reset Err.
Any suggestions appreciated.
Network I/O Error Or System Error Device Error
I am getting an Error. I believe it is a NetworkError DeviceError or SystemError
I was wondering if someone knows how to trap these errors in VBA.
There is a pressing need for a solution.
Any help would be appreciated.
Thanks Sirron
Error 70, Error 91 And Error List Separator
Hello!
I've got this problem:
I created a folder with visual basic
When I try to delete it(and only that dir...) with this code:
>Dim fso As FileSystemObject
>...
>fso.DeleteFolder defaultInstallFolder & "Config", True
I obtain "Permission denied", just like if folder is in use.. but it's in use from vb!
(The utility "Who lock me?" tells me that it's locked form vb)
I tried to change current dir to parent dir of folder to delete, but i didn't help.
If I try to delete directory just after have created, in another piece of code, the error changes:
"Object variable or With block variable not set"
I've read that perhaps it's a Microsoft bug, to solve using properties, so I made:
>Dim fso As FileSystemObject
> ...
> Public Property Get ob() As FileSystemObject
> ob = fso
> End Property
> Public Property Let ob(Object As FileSystemObject)
> fso = Object
> End Property
and tried to delete it using:
>Get ob.DeleteFolder defaultInstallFolder & "Config", True
but the error now is "Expected: list separator"
or I tried:
>Get ob().DeleteFolder defaultInstallFolder & "Config", True
>...
>Dim fso2 As FileSystemObject
>fso2 = Get ob (compile error)
The question is: HOW THE HELL CAN I DELETE THE FOLDER ? :-)
I can't understand the problem, I can easily delete other directories created in the same code 2-3 lines above, but THAT directory not. And neither in different Pcs, same problem.
I can only use vbcce5..
Thank you for responses!!
"On Error GoTo DoSomething_Error" Returns Error 0.. What Is Error 0??
Hello, I have a try/catch function is always is cought with an error0... What is an Error 0?
here is my code:
Code:
Private Sub ProcessCreditCard_Timer()
Dim CCstatus As String
Dim racAuthCard As Variant
Set racAuthCard = CreateObject("RACAuthcreditcard.Authcreditcard")
racAuthCard.transactionKey = "asdfasdfasfffff"
racAuthCard.login = "asfdsad"
racAuthCard.transactionType = "AUTH_CAPTURE"
Question = "Processing Credit Card Now. Please Standby."
On Error GoTo DoSomething_Error
CCstatus = racAuthCard.Authcreditcard(Total, CCnumber, ExpMonth, ExpYear, CCFirstName, CCLastName)
ProcessCreditCard.Enabled = False
If CCstatus = "This transaction has been approved." Then
Question = "Credit card transaction approved. One moment."
CCnumber = Right(CCnumber, 4)
Paidby = "Credit Card"
Call Thankyou
ElseIf CCstatus = "Problem! reason: The credit card number is invalid." Then
'CCnumber = Right(CCnumber, 4)
CCnumber = "0"
Question = "Credit Number invalid or NSF. Press the Start button to start again."
ElseIf CCstatus = "(TESTMODE) This transaction has been approved." Then
CCnumber = "TESTMODE" 'Right(CCnumber, 4)
Paidby = "TESTMODE"
Call Thankyou
Else
'CCnumber = Right(CCnumber, 4)
CCnumber = "0"
Question = "Authentication channel not found. Please try again in 30 seconds."
End If
Exit Sub
DoSomething_Error:
Select Case Err.Number
Case -2147012889 'cannot resolve DN
'MsgBox ("cnrdn")
CreditCardAuthRetry = CreditCardAuthRetry + 1
'Command1.Caption = CreditCardAuthRetry
If CreditCardAuthRetry > 100 Then
ProcessCreditCard.Enabled = False 'try for 1 second
Question = "Authentication channel not found. Please try again in 30 seconds."
End If
Case 0
'This is to catch all successful Credit Card Processes.. so it doesn't go to else
Case Else
'MsgBox ("Sorry we are having technical difficulties")
'email me the error number
ProcessCreditCard.Enabled = False
CCnumber = "0"
Question = "I am sorry, but we cannot take credit cards right now. "
'Call ClearAll
End Select
End Sub
and I know the credit card processing goes through fine (I can login to my merchant account and see it)...
what does an Error 0 mean, should I be worried? I basically setup my catch statement to ignore an error 0 .. but i want to know if that is a good idea .. or if i can "fix" this issue?
thanks!
Lee
Error 2147023067 (80070725) Automation Error" Launching Excel Sheet From VB App.
Hi All,
I have done a simple VB application that launches a excel sheet, this has worked proppely from my developement computer (WIN XP) and the package has been installed and the app. works propperly in another XP computer.When I have installed this same package in the Win 98 computer running the app. , launching the excel appears the message:
"Error 2147023067 (80070725) Automation error" , specifically at the code point:
wrbRes.Sheets(1).Range(strStart, strEnd).Borders(xlTop).LineStyle = xlSquare
I have done the same test in a WINNT developement computer (with VB installed) and I get the same trouble.
I have read that could be done due to an update of the windows system files when the package is installed.(OLEAUT.DLL specifically)
Thanks in advance for your help,
Al
VB 6 - Run-Time Error 3075 Syntax Error (Missing Operator) In Query Expression
Hi all
sorry for the inconveniences, I just wanna get this syntax thing out of my back.
I modified my vb module and now I'm getting "Run-Time error 3075 syntax error(Missing operator) - query expression"
Then it displayed this line of code as the problem line:
Code:
'TblPersonnel.[Name] = TblRequests.Personnel1 Union All
Select TblRequests.ProjectID'.
Below is the complete module:
Code:
DbPath = "\515opsisdallf00008SHAREDPyrlAppsPTStest2"
DbName = "PTS.mdb"
Set Db = OpenDatabase(DbPath & DbName)
strSQL = "Insert Into TblProgrammersHours (ProjectID,ProgrammerInitials, CurrProgHrs, PrevProgHrs, TotalProgHrs, Positions)"
strSQL = strSQL & " Select TblRequests.ProjectID, TblPersonnel.Initials, TblRequests.Prog1hrs, TblRequests.PrevProg1Hrs, TblRequests.TotalProg1hrs, 1 As Position " _
& "From TblRequests Inner Join tblPersonnel On TblPersonnel.[Name] = TblRequests.Personnel1 "
strSQL = strSQL & "Union All " _
& " Select TblRequests.ProjectID, TblPersonnel.Initials, TblRequests.Prog2hrs, TblRequests.PrevProg2Hrs, TblRequests.TotalProg2hrs, 2 " _
& "From TblRequests Inner Join tblPersonnel On TblPersonnel.[Name] = TblRequests.Personnel2 "
strSQL = strSQL & "Union All " _
& " Select TblRequests.ProjectID, TblPersonnel.Initials, TblRequests.Prog3hrs, TblRequests.PrevProg3Hrs, TblRequests.TotalProg3hrs, 3 " _
& "From TblRequests Inner Join tblPersonnel On TblPersonnel.[Name] = TblRequests.Personnel3 "
strSQL = strSQL & "Union All " _
& " Select TblRequests.ProjectID, TblPersonnel.Initials, TblRequests.Prog4hrs, TblRequests.PrevProg4Hrs, TblRequests.TotalProg4hrs, 4 " _
& "From TblRequests Inner Join tblPersonnel On TblPersonnel.[Name] = TblRequests.Personnel4 "
strSQL = strSQL & "Union All " _
& " Select TblRequests.ProjectID, TblPersonnel.Initials, TblRequests.Prog5hrs, TblRequests.PrevProg5Hrs, TblRequests.TotalProg5hrs, 5 " _
& "From TblRequests Inner Join tblPersonnel On TblPersonnel.[Name] = TblRequests.Personnel5 "
strSQL = strSQL & "Union All " _
& " Select TblRequests.ProjectID, TblPersonnel.Initials, TblRequests.Prog6hrs, TblRequests.PrevProg6Hrs, TblRequests.TotalProg6hrs, 6 " _
& "From TblRequests Inner Join tblPersonnel On TblPersonnel.[Name] = TblRequests.Personnel6 "
strSQL = strSQL & ") As NewProgHrsTbl"
Call Db.Execute(strSQL)
Thanks.
tgifgemini
Run Time Error (80040111) Automation Error ClassFactory Cannot Supply Requested Class
Anyone ever get this error ?
Run-time error '-2147221231 (80040111)':
Automation error
ClassFactory cannot supply requested class
I get this error when i am doing a Set MyShortcut = VBsObj.CreateShortcut(ShortCutPath & ".lnk")
I am only trying to create a shortcut here...and the server running this program is Windows 2000... Please advise..
RunTime Error 3075 - Syntax Error (Missing Operator) In Query Operession
Hi all
sorry for the inconveniences, I just wanna get this syntax thing out of my back.
I modified my vb module and now I'm getting "Run-Time error 3075 syntax error(Missing operator) - query expression"
Then it displayed this line of code as the problem line:
Code:
'TblPersonnel.[Name] = TblRequests.Personnel1 Union All
Select TblRequests.ProjectID'. <==== Error occurs here
I can't seem to figure out why my SQL statement is bumming out on the above line.
Below is my complete module:
Code:
DbPath = "\515opsisdallf00008SHAREDPyrlAppsPTStest2"
DbName = "PTS.mdb"
Set Db = OpenDatabase(DbPath & DbName)
strSQL = "Insert Into TblProgrammersHours (ProjectID,ProgrammerInitials, CurrProgHrs, PrevProgHrs, TotalProgHrs, Positions)"
strSQL = strSQL & " Select TblRequests.ProjectID, TblPersonnel.Initials, TblRequests.Prog1hrs, TblRequests.PrevProg1Hrs, TblRequests.TotalProg1hrs, 1 As Position " _
& "From TblRequests Inner Join tblPersonnel On TblPersonnel.[Name] = TblRequests.Personnel1 "
strSQL = strSQL & "Union All " _
& " Select TblRequests.ProjectID, TblPersonnel.Initials, TblRequests.Prog2hrs, TblRequests.PrevProg2Hrs, TblRequests.TotalProg2hrs, 2 " _
& "From TblRequests Inner Join tblPersonnel On TblPersonnel.[Name] = TblRequests.Personnel2 "
strSQL = strSQL & "Union All " _
& " Select TblRequests.ProjectID, TblPersonnel.Initials, TblRequests.Prog3hrs, TblRequests.PrevProg3Hrs, TblRequests.TotalProg3hrs, 3 " _
& "From TblRequests Inner Join tblPersonnel On TblPersonnel.[Name] = TblRequests.Personnel3 "
strSQL = strSQL & "Union All " _
& " Select TblRequests.ProjectID, TblPersonnel.Initials, TblRequests.Prog4hrs, TblRequests.PrevProg4Hrs, TblRequests.TotalProg4hrs, 4 " _
& "From TblRequests Inner Join tblPersonnel On TblPersonnel.[Name] = TblRequests.Personnel4 "
strSQL = strSQL & "Union All " _
& " Select TblRequests.ProjectID, TblPersonnel.Initials, TblRequests.Prog5hrs, TblRequests.PrevProg5Hrs, TblRequests.TotalProg5hrs, 5 " _
& "From TblRequests Inner Join tblPersonnel On TblPersonnel.[Name] = TblRequests.Personnel5 "
strSQL = strSQL & "Union All " _
& " Select TblRequests.ProjectID, TblPersonnel.Initials, TblRequests.Prog6hrs, TblRequests.PrevProg6Hrs, TblRequests.TotalProg6hrs, 6 " _
& "From TblRequests Inner Join tblPersonnel On TblPersonnel.[Name] = TblRequests.Personnel6 "
strSQL = strSQL & ") As NewProgHrsTbl"
Call Db.Execute(strSQL)
Thanks.
giftx
Runtime Error '3077' Syntex Error (missing Operator) In Expression
Hi everyone,
I have a combo box on a form that finds records in a table or query. It works fine except for string with an apostrophe on it - and the string is,
IED_Headcount 'ADODB' error message
It gives me a Runtime Error '3077' Syntex error (missing operator) in expression. I found out the reason I am getting this error is because the word 'ADODB' has aphostrophe on it.
My code for the Find Records Combo Box is,
Private Sub Combo84_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Issue] = '" & Me![Combo84] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Can you please help me with the necessary code to escape the error.
I certainly appreciate your help and thank you in advance.
Dewan
On Error Return False?? VB Will Treat A Statement As True If Error Occurs In It
VB Code:
On Error Resume Next Dim zrr() As String zrr = Split("", " ") If zrr(1) = "001" Then MsgBox "help" End If
clearly, i should not be getting that msgbox, but i do
its even more annoying when u have something like
VB Code:
dowb.navigate "www.hotmail.com"doevents: sleep 10loop until wb.busy = false or instr(wb.document.documentelement.innerhtml,"login") > 0
this will just execute the next lines even though both statements are false (but sometimes an error will occur on the wb.document.documentelelement statement)..
does anyone know a good way to get around this?
a side note: im checking if 'login' (as an example) exists in the html, because there is no need to load the entire page, i can perform my code once data upto this point is received
Excel XmlHTTP Object Error Message - System/runtime Error
Hi guys,
Thanks for reading my thread. This is a VBA problem for something in Microsoft Excel - I wasnt sure if I should really be posting this problem on this kind of forum, so apologies if I am in completely the wrong place! I have looked on google and used the search feature and found very limited information that is useful to me.
I am having trouble with a very simple few lines of code in a macro. The code looks like this:
Code:
Function startmarketIDs()
Dim targeturl, writerow, readrow, textmass, xmlHTTP
targeturl = "http://lite.betfair.com/Events.do?s=00010913z"
Set xmlHTTP = CreateObject("Microsoft.xmlHTTP")
xmlHTTP.Open "GET", targeturl, False
xmlHTTP.send
MsgBox xmlHTTP.StatusText
textmass = xmlHTTP.responsetext
MsgBox textmass
End Function
My problem occurs at the line "textmass = xmlHTTP.responsetext"
The responsetext command is obviously causing problems because if I remove it, the code executes without error and the "xmlHTTP.statustext" says "OK". With the responsetext command left in, the code generates the following error:
Run-time error '-1072896658 (c00ce56e)':
System Error: -1072896658.
If I change the targeturl to www.betfair.com, the code executes fine and I get a message box (as desired) with the source code of the website displayed. There is therefore something about the url or the way in which I am using the xmlHTTP object that is causing the issue, I wondered if someone would mind inspecting my code and perhaps pointing me in the right direction?
I am not an expert in VBA programming, and I feel a little out-of-my-depth using the xmlHTTP object, but Id really like to get hold of the source code of the targeturl so that I can parse it for some data that I require. Thanks to anyone who can offer me any assistance,
Regards,
Porky / Paul
Visual Basic Runtime Error "Error Saving Document
Dear all,
I am saving a document from vb. While saving I get this error. This error occurs only when I run the exe file. This problem doesnt occur while developing the project.
There is no problem with the path. What else may be the problem?
How to rectify this error " Error saving Document" in visual basic 6.0
Pls Help, this is very urgent.
Thanks to all.
Rgds,
Visha
Error Visual Basic: ! Compile Error. Can't Find Project Or Library
Hi all,
When running a program I made in VB under Windows XP i'm getting the
following error: ! Compile error. Can't find project or library. (see also
http://home.kabelfoon.nl/~hspies/2.jpg )
See the code where it stucks: http://home.kabelfoon.nl/~hspies/1.jpg
Ubder Windows 98 this error does not occur. Who knows what I do wrong, I've
tried a lot but the error keeps coming in Win XP. Thanks.
John
Error -2147467259 - Unspecified Error - Pointing To DB Connection String ? (URGENT)
I have had my system running on and off in memory for some time now (maybe a couple of hours)...
On my most recent compilation/execution of the system, I was able to open and close several forms before I was presented with an error.
After I had opened and closed around 5 forms, and tried to open another, this error appeared:
Error -2147467259
Unspecified Error
Highlighting in yellow this line in my Form_load:
Code:
db.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & ConnPath & "MyDatabase.mdb";
I have also just tried adding a record, it works fine.
I add 5 records, adding them fine.
When I get to around 10, this error comes up again, and points to the same line on my connection string.
NOTE: Nowhere have I closed my database (eg. db.close)
Everytime I am saving my records I am refreshing the form to be sure it is up to date.
Could this be causing the problem?
Do I need to close the database and then reopen after every transaction ?
Thanks
SQL7 Stored Procedure Error: Syntax Error Or Access Violation
Using VB6 SP5, ADO 2.7, Sql7 SP4.
When I try to execute any stored procedure I get the error:
Run-time error '-2147217900 (80040e14)':
Syntax error or access violation
Dim cAck As ADODB.Command, cParam As ADODB.Parameter
Set cAck = New ADODB.Command
cAck.name = "sp_Test1"
cAck.CommandType = adCmdStoredProc
cAck.ActiveConnection = oCon
cAck.Execute
oCon is connection that is made prior and specifies the inital catalog. I can do anything else using this including views and update queries but when I try to access any stored procedure I get the above error. I even scaled back to a simple stored procedure that does nothing and get the same error.
Truely lost on this one.
-J
E-mail (plz Help Me With Code) Error Message Compile Error: ByRef Argument Type Mismatch
hi!,
I am trying to get help since 4 weeks but I haven't had an reply.
I am creating a software. I am using "Microsoft Access". This is what the software does. The user chooses a category from the category combo box. This category is coming from the database. When the user has choose the category that category details come into the "Microsoft Flex Grid" such as item name and price. The user then chooses which item they want by using the "Forward" command button. The item names are added to the list box. The user then enters details such as name and surname. After this when the user clicks on the "Submit" command button the items in the list box and details are added to the database. This is what i want. I want to send an e-mail to the customer. when I click on the "Submit" command button i get this error message Compile error: ByRef argument type mismatch and also the code is highlighted.
This is the code.
Code:
Private Sub cmdSubmit_Click()
Dim sql As String
Dim cmdCommand As ADODB.Command 'declare command object
Set cmdCommand = New ADODB.Command 'command object is instantiated
cmdCommand.ActiveConnection = g_dbExoticicesConn 'valid connection object that is already open
cmdCommand.CommandType = adCmdText 'CommandType is set
'Counter that goes through listbox items
Dim tmp
For i = 0 To List1.ListCount - 1
tmp = tmp & "-" & List1.List(i)
Next i
'Insert Into the Database
sql = "Insert Into tblCustomerOrderForm(CustItems) values ('" & tmp & "')"
cmdCommand.CommandText = sql
cmdCommand.Execute
Set cmdCommand = Nothing
'Assign all the text boxes to the field
adoExoticices.Recordset!CustTitle = IIf(txtCustTitle = "", "N/A", txtCustTitle)
adoExoticices.Recordset!CustName = IIf(txtCustName = "", "N/A", txtCustName)
adoExoticices.Recordset!CustSurname = IIf(txtCustSurname = "", "N/A", txtCustSurname)
adoExoticices.Recordset!CustAddress = IIf(txtCustAddress = "", "N/A", txtCustAddress)
adoExoticices.Recordset!CustCounty = IIf(txtCustCounty = "", "N/A", txtCustCounty)
adoExoticices.Recordset!CustCity = IIf(txtCustCity = "", "N/A", txtCustCity)
adoExoticices.Recordset!CustPostcode = IIf(txtCustPostcode = "", "N/A", txtCustPostcode)
adoExoticices.Recordset!CustTelephonenumber = IIf(txtCustTelephonenumber = "", "N/A", txtCustTelephonenumber)
adoExoticices.Recordset!CustMobilenumber = IIf(txtCustMobilenumber = "", "N/A", txtCustMobilenumber)
adoExoticices.Recordset!CustEmailaddress = IIf(txtCustEmail = "", "N/A", txtCustEmail)
adoExoticices.Recordset.Update
MsgBox "Record has been successfully Updated", vbOKOnly + vbInformation, Message
Call SendMail(strSendTo, strSubject, strMessage) 'strSendTo is highted.
End Sub
Code:
Private Function SendMail(strTo As String, strSub As String, strMsg As String)
'opens link to outlook and then creates a mail item
'*******************************
'declare objects'
Dim olApp As Outlook.Application
Dim olNS As NameSpace
Dim olMessage As MailItem
'******************************
'**********************************************
'instantiate objects
Set olApp = CreateObject("Outlook.Application")
Set olNS = olApp.GetNamespace("MAPI")
Set olMessage = olApp.CreateItem(olMailItem)
'**********************************************
'*************************
'set the properties of the object
olMessage.To = strTo
olMessage.Subject = strSub
olMessage.Body = strMsg
'*************************
olMessage.Send 'send method of object
olApp.Quit 'quit method of object
'clear the objects to free up memory
Set olApp = Nothing
Set olNS = Nothing
Set olMessage = Nothing
'declare string variables'
Dim strSendTo As String
Dim strSubject As String
Dim strMessage As String
strSendTo = txtCustEmail.Text
strSubject = "Exoticices"
strMessage = "Reference Number: " & txtId.Text & vbNewLine
strMessage = txtCustTitle.Text & txtCustSurname.Text & vbNewLine
strMessage = "The items you have requested to order are being ordered and we will contact you when the items will be delivered. The items will take 28 days to be delivered."
End Function
What shd I do? Can u send me sample code. If u send me sample code can u plz explain what the code means.
Anways plz let me know as soon as possible.
Thank you for ur help in this matter.
Can u plz let me know any changes.
MSComm Error 8020(Error Reading Comm Device)
Does anyone know more about this error?
Communication with a modem connected on a serial port gives no problems, but the same code gives run-time error 8020(Error reading comm device) when I want to work with a gsm mobile over infrared (I can read the inbuffercount property of the msComm object, but the reading the input property throws the error).
code as follow:
MSComm1.Settings = "9600,N,8,1"
MSComm1.CommPort = 4
MSComm1.PortOpen = True
MSComm1.Output = "AT" + vbCr
retStr = MSComm1.Input
intRet = MSComm1.InBufferCount
Thank you for your reply.
Getting A Run-time Error '3134' Syntax Error In INSERT INTO Statement
Code:
Private Sub cmdMass_Click()
Dim db As Database
Dim rs As Recordset
Dim datHold As Date
Dim datStart As Date
Dim datEnd As Date
Dim intID As Integer
Dim strSQL As String
Set db = CurrentDb
Set rs = db.OpenRecordset("qryEmployeeIDs") 'gets unique IDs
rs.MoveFirst
datHold = #12/30/2000#
datStart = datHold
Do While Not rs.EOF
Do While datEnd < #4/1/2006#
datEnd = DateAdd("d", datStart, 13)
intID = rs![Employee_ID]
DoCmd.SetWarnings False
strSQL = "Insert tblSick_Leave(Employee_ID, Pay_Period_StartDate, Pay_Period_EndDate,
Begining_Balance_Hours, Begining_Balance_Minutes, Earned_Hours,
Earned_Minutes, Used_Sick_Hours, Used_Sick_Minutes,
Ending_Balance_Hours, Ending_Balance_Minutes) Values ('" & intID & "', #" &
datStart & "#, #" & datEnd & "#, '0', '0', '0', '0', '0', '0', '0', '0')"
datStart = DateAdd("d", datStart, 14)
Loop
rs.MoveNext
Loop
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
DoCmd.SetWarnings True
End Sub
First, allow me to say that I have broken the statement down to multiple lines for readability issues here. Basically, what I want it to do is insert the date ranges for previous pay periods into the table or each employee as well as entering 0 into the record for each other field in the table. I am having a few issues with that as I am getting this error and I have tried everything to get it to work, but I keep getting this runtime error. Any thoughts on this?
Error 1004: Application-defines Or Object-defined Error
Hello there,
while trying to write a script I get this error.
Here is minimal script which reproduces the error (working with Win XP and Office 2003 Sp3).
Code:
Function foo()
On Error GoTo Hell
Dim i As Integer
For i = 1 To 4
Dim r As Integer
r = Application.Caller.Row
Dim c As Integer
c = Application.Caller.Column
Dim s As Integer
s = Application.Caller.Worksheet.Index
MsgBox ("Sheets(" & s & ").Cells(" & r & ", " & c & ")")
Sheets(s).Cells(r + i, c + i) = "bar" ' this line produces the error
'Sheets(1).Cells(1,1) = "bar" produces the same error :(
Next i
foo = i
Exit Function
Hell:
MsgBox "Error-No.: " & Err.Number & vbNewLine & vbNewLine _
& "Description: " & Err.Description _
, vbCritical, "Fehler"
End Function
I tried to ask google, but I could not find any working results.
I really hope anybody here can point me to a solution.
Regards
Declaring An Error Handler / On Error GoTo In The General Declarations?
Ive been reading in books that somehow you can declare an On Error GoTo ErrorHandlerProcedure in a forms general declarations, and also to declare the actual error handler itself in the general declarations...
But when I tried this it didnt work!
It didnt show an example, but I'm guessing its written the same way as you'd normally write an On Error GoTo and the Error Handler, but maybe I'm wrong?
Can anyone please help by giving me an example of how its done?
Thanks
VB Error While Connecting To Oracle =Run-time Error '-2147467259 (80004005)'
I have created a VB program using VB6 to connect to Oracle8i Release 8.1.7.0.0. Below is DLL that i use and my connection string.
microsoft ActiveX Data Objects 2.5 Library
"Provider=MSDAORA.1;Password=" & strpassword & ";User ID=" & strUserId & ";Data Source= & strdbservice
This error occurred while connecting :
"Run-time error '-2147467259 (80004005)':
oracle error occurred, but error message could not be retrieved from oracle."
However, after 3 - 4 times of attempt i manage to connect to the database without any problem. So each time i run my vb file I need to click a few times until it manage to go through my itself.
Average attempt is 3 times.
Please help.
'Error In GetMaxIssue: ActiveX Component Can't Create Object' Error???
Hi I have the above error.
The VB code accesses mdb database and works OK when package installed. (package developed by external group)
BUT when this package is uninstalled and I install my new install :-
I have created a new install, that copies program files and installs MDAC 2.5.
Can anyone help me with what Dlls/components are missing to get the above error??????
This is the connection to Database:-
Set rs = New ADODB.Recordset
sSQL = "Select Max(IssueNo) From Issues"
rs.Open sSQL, oADOCon, adOpenStatic
Thanks
Matt
Validation Error. When Record In MySQL Not Present, Shows Error.
I have a form that searches a MySQL database using ADODC. When the order id entered exists it shows the information without a problem. However,when the order id is not present, it shows the following error message. I would like for it to bring up a msgbox instead telling the user that the order ID does not exist. (Code is provided.) Please help if you can.
When I click the debug button, the following line is highlighted:
VB Code:
lblUsername.Caption = Adodc2.Recordset.Fields("UserName").Value
Error Message:
Run-time error: '3021':
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record.
VB Code:
Private Sub btnViewTranscriptionOrder_Click()'search the member database depending on the order IDIf txtTranscriptionOrderID <> "" ThenAdodc2.RecordSource = "SELECT * " _& "FROM transcribe" _& " WHERE nomer = '" & txtTranscriptionOrderID & "'"Adodc2.Refresh 'now display all the information for that transcription order idlblUsername.Caption = Adodc2.Recordset.Fields("UserName").ValuelblSenderFirstName.Caption = Adodc2.Recordset.Fields("SenderFirstName").ValuelblSenderLastName.Caption = Adodc2.Recordset.Fields("SenderLastName").ValuelblSenderAddress.Caption = Adodc2.Recordset.Fields("SenderAddress").ValuelblRecipientFirstName.Caption = Adodc2.Recordset.Fields("RecipientFirstName").ValuelblRecipientLastName.Caption = Adodc2.Recordset.Fields("RecipientLastName").ValuelblRecipientAddress.Caption = Adodc2.Recordset.Fields("RecipientAddress").ValuelblBrailleTranscriptionType.Caption = Adodc2.Recordset.Fields("BrailleType").ValuetxtTranscriptionText.Text = Adodc2.Recordset.Fields("LetterContent").ValueElseMsgBox ("Transcription ID does not exist.")End IfEnd Sub
SQL Error ODBC Visual FoxPro Driver: Syntax Error
Can somebody tell me what is wrong about the query (bold) and a solution for it?
VB Code:
Public cn As New ADODB.ConnectionPublic rs As New ADODB.RecordsetPublic cn2 As New ADODB.ConnectionPublic rs2 As New ADODB.Recordset Private Sub cmdOpenBron_Click() Dim naam As String Set cn = New ADODB.Connection cn.Open "Driver={Microsoft Visual FoxPro Driver};" & _ "SourceType=DBC;" & _ "SourceDB=J:BjornDatadubois.dbc;" & _ "Exclusive=No" Set rs = cn.Execute("Select * from KLPX") Set cn2 = New ADODB.Connection cn2.Open "Driver={Microsoft Visual FoxPro Driver};" & _ "SourceType=DBF;" & _ "SourceDB=C:WINBOOKSdataParfiNV;" & _ "Exclusive=No" Set rs2 = cn2.Execute("Select * FROM PARFINV_csf") While Not rs.EOF While Not rs2.EOF If Not rs![KL_NAM] = rs2![NAME1] Then naam = rs![KL_NAM] [b]cn2.Execute "INSERT INTO PARFINV_csf [(NAME1)] VALUES '" & naam & "'"[/b] End If Wend Wend cn.Close Set rs = Nothing Set cn = Nothing cn2.Close Set rs2 = Nothing Set cn2 = Nothing
Thanx alot in advance
Run-time Error '40006' : Wrong Protocol .... <== How This Error Occurs?
Run-time error '40006' :
Wrong protocol or connection state for the requested transaction or request.
How this error occurs?
What error is it about?
How can we fix this error?
In my vb-application I used winsock and timer control.
And set timer to run every 5 minute.
But this error occurs unexpectially.
Best Regards
Starting To Pull Hair Out. On Error Ignore Error Control. Help!
Ok i posted about this yesterday and tryed a few things but it still did not work for me.
A runtime popup error occures when the first "If Dir" executes. But only if I do not have access to the share. Even though the "on error" code is there. I have tryed using a goto and label also but that doesn't work either. I have the settings on the general tab set to "Break on unhandled errors"
Code:
On Error Resume Next
If Dir("\" & strServerName & "c$
avupd
avplay.exe") <> "" Then
If Dir("\" & strServerName & "c$
avupd
avplay.exe") <> "" Then
Text = "Installed"
Else
Text = "Not Installed"
End If
Else
Text = "Not Installed"
End If
Package And Deployment : Error 75 : Path/file Access Error
I am trying to build a setup package for a VB 6 project. I get a "Unexpected error 75:Path/file access error" and
writing setup.lst goes on forever.
I tried to remove all references but the error still persists. Could somebody please let me know what could be the possible solution to this.
Thanks.
Error 1603: Error Installing Windows Installer Engine.
Hello,
I hope someone can help me and also sorry if I have the wrong forum!
I work in Technical Support for an Insurance company. We have recently changed the installer of the software to InstallShield and I have two users who are both using Windows NT and are having major difficulties loading on our software.
The Error message they are getting is:
Error 1603: Error installing Windows Installer engine. A file which needs to be replaced may be in use. This installation package cannot be installed by the windows installer service. You must install a newer version of the Windows Installer Service.
I have gone through a download of Windows Service Pack 6 for NT.
I have also tried to download instmsiw.exe but then get this message:
There was a problem with this Windows Installer Package. A program run as part of the setup did not finish as expected.
I also tried to download the Windows SoapToolkit as I looked on the Internet for information and the info I found was very similar to another problem that we have which is fixed by installing this SoapToolkit. However this will not load on my users machine.
I hope all this has made some sense!!
If you have any information for me at all it would be greatly appreciated!
Thank you
Declaring An Error Handler / On Error GoTo In The General Declarations?
Ive been reading in books that somehow you can declare an On Error GoTo ErrorHandlerProcedure in a forms general declarations, and also to declare the actual error handler itself in the general declarations...
But when I tried this it didnt work!
It didnt show an example, but I'm guessing its written the same way as you'd normally write an On Error GoTo and the Error Handler, but maybe I'm wrong?
Can anyone please help by giving me an example of how its done?
Thanks
Edit By Shandy: Moved from VB Databases to VB Newbies forum - Please post in forum appropriate to question content
Edited by - Shandy on 4/17/2004 9:18:22 PM
ERROR 3077 : Syntax Error (Missing Operator) In Expression
Hi,
I am trying to use the "Findfirst" method to locate records in my database.
However, the command just raises the Runtime error 3077
please help!!!!!!!!!!
I've inserted the code below!
Code:Private Sub commloadform_Click()
Dim testno As String
DataList.Recordset.MoveFirst
Do While Not DataList.Recordset.EOF
DialogWhichTest!TestNoCombo.AddItem (DataList.Recordset.Fields("Job Number").Value)
DataList.Recordset.MoveNext
Loop
DialogWhichTest.Show vbModal, FormICS2000
testno = TestNumberForICS2000
If testno = "" Then
Exit Sub
End If
findtest = "Job Number = '" & CStr(testno) & "'"
DataList.Recordset.FindFirst (findtest)
Call UpdateDisplay
End Sub
Client Side RDS Error 8447 (Internet Server Error)
I have an windows application communicating with MTS business objects via RDS. The application has been in use since 1999 and working successfully with a variety of remote clients. I have one new client that keeps getting an 8447 Internet Server Error. They are the only ones, so it does not appear to be an ADCLaunch security type of error. The business objects were created using MDAC 2.6 and the client is running Windows 2000, IE 5 SP1, MDAC 2.7 and is behind a Cisco Pix firewall. Any ideas? Much appreciated!
RunTime Error 75: Path/File Access Error.
Hi all,
This is blowing my mind!
I have the following piece of code which I have been testing:-
Code:
file_name = "C:Documents and SettingsHomeDesktopTest1.xls"
save_to = "D:Test1_(" & Format(Now, "dd-mmm-yyyy") & " " & Format(Now, "hh_mm_ss") & ") " & ".xls"
FileCopy file_name, save_to
I have run the code 14 times (on separate cd's) and it's copied the file to the cd drive ("D:") every single time.
All of a sudden, I am getting a RunTime Error 75: Path/File access error . Why?
If I manually copy and paste to the D drive it works. I use FileCopy, it returns an error. I change the path from D to C, it works. I have searched millions of sites and cannot find an answer.
Thanks in advance,
Paul.
|