Hi Compliments of the day,
I'm a new bie in vb and trying to write a class that'll insert & search a field but wen i run the program it says this: COMPILE ERROR: Sub or Function not defined.
Pls can someone assist me on how to go about it?
Thanks
6 1307
How do you expect us to help you without knowing anything about your code and what exactly you are trying to do and how you are trying to connect to which database.
Hi Compliments of the day,
I'm a new bie in vb and trying to write a class that'll insert & search a field but wen i run the program it says this: COMPILE ERROR: Sub or Function not defined. -
Private Sub cmdLoad_Click()
-
-
OpenDialog.CancelError = True
-
On Error GoTo ErrHandler
-
-
-
OpenDialog.DialogTitle = "Open File"
-
OpenDialog.Filter = "Text Files (*.txt)|*.txt"
-
OpenDialog.FilterIndex = 1
-
OpenDialog.ShowOpen
-
strFileName = OpenDialog.FileName
-
'OpenDialog.Flags = cdlOFNFileMustExist + cdlOFNHideReadOnly
-
Dim Called, Calling, Start, Stp, Duration, Incom, OutCom As String
-
-
-
Dim Stream As TextStream
-
Dim StrA As String
-
Dim RecA As String
-
Dim Record As String
-
Dim Rec As String
-
Dim i As Integer
-
Dim j As Integer
-
-
'Try
-
Rec = ReadAll
-
For j = 0 To i - 1
-
-
'Record = StrA(j)
-
RecA = Split(",")
-
Dim iLen As Integer
-
RecA = Length
-
Dim K As Integer
-
If j = i Then Exit For
-
-
-
Called = RecA
-
Calling = RecA
-
Start = RecA
-
-
Stp = RecA
-
Duration = RecA
-
Incom = RecA
-
OutCom = RecA
-
-
InsertRecord Into(Called, Calling, Start, Stp, Duration, Incom, OutCom)
-
-
Next
-
OpenDialog.CancelError = True
-
On Error GoTo ErrHandler
-
-
MsgBox("File Loaded Successfully", vbOKOnly, "File Upload") = vbOK
-
-
-
End Sub
-
-
-
Private Function InsertRecord(Caled As String, Calling As String, Start As String, EndTime As String, Duration As String, Inco As String, OutCo As String)
-
sSQL = "Insert into " & cbocity.Text & cboTraffic.Text & "Values('" & Caled & "','" & Calling & "','" & Start & "','" & _
-
EndTime & "','" & Duration & "','" & Inco & "','" & OutCo & "')"
-
-
End Function
Pls can someone assist me on how to go about it?
Thanks
Both the threads are merged for better management of the forum.
Are you trying to insert data into a database ?
Yes I'm trying to insert it into a database
Thank you
Yes I'm trying to insert it into a database
Thank you
1.Where is the conection string .
2.What is the output type of the function.
3.Why using a function where you don't actually need to return a value., which can be done in a procedure
4.Your SQL statment is wrong.
5.Why using INTO after the function name to call it .
6.Calling a function without any variable. It is not a procedure.
Take care of the above mentioned issues.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: DTB |
last post by:
I am having trouble creating an INSTEAD OF trigger in SQL Server to
replicate a BEFORE UPDATE trigger from ORACLE.
Here is a sample of the ORACLE BEFORE UPDATE trigger:
CREATE TRIGGER myTRIGGER ON...
|
by: george |
last post by:
This is like the bug from hell. It is kind of hard to explain, so
please bear with me.
Background Info: SQL Server 7.0, on an NT box, Active Server pages
with Javascript, using ADO objects.
...
|
by: Philip Boonzaaier |
last post by:
I want to be able to generate SQL statements that will go through a list of
data, effectively row by row, enquire on the database if this exists in the
selected table- If it exists, then the colums...
|
by: Mike |
last post by:
I know this sounds strange but I am at a loss. I am calling a simple
funtion that opens a connection to a SQL Server 2000 database and executes
an Insert Statement.
private void...
|
by: r_o |
last post by:
hi i'm new to this issue
i'm developping a web application with an access database
in my application there's a loop that gets values of a form
like:
lastElt=request("numberOfItems")
for...
|
by: gmccallum |
last post by:
I would have expected to be able to find this easily, but I couldn't.
I am using the TableAdapter.Insert command to insert a record.
I would like to then get an ID field from that record after...
|
by: new |
last post by:
I am building an effective dated file that shows results to date.
In part 1 of the select I
I process a larges set of input and genrate records for each date in the
processing period for which...
|
by: MLH |
last post by:
Suppose, in a multi-user environment, you
have append query SQL in a VBA procedure
that looks like INSERT INTO MyTable...
and the next line reads MyVar=DMax("","MyTable...
You can never be...
|
by: leedo |
last post by:
Hi,
I am almost going crazy with this. I have a table that I bulk insert into from another database using VS2005.
I need to change the data in the records before committing the values in the...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |