Hi...im doing a query tools using vb6 that runs a query in access, How can i do so....im confused...plz guide me....
32 2538
You just need to frame the query properly and execute that using ADO objects.
Im not understand..plzzzzzz guide..i'll thank 4 u
Do you know how to execute a query in VB ?
I had do the query n it was success . Thank u.Now i face difficulities in trim character from a coloumn like 101-001 to 101001. It can do by run a query in access directly but in vb6 i cant...
UPDATE Alternator
SET EversparkNo1 = REPLACE(EversparkNo1, '-', '')
this 1 i do in access query directly
I had do the query n it was success . Thank u.Now i face difficulities in trim character from a coloumn like 101-001 to 101001. It can do by run a query in access directly but in vb6 i cant...
UPDATE Alternator
SET EversparkNo1 = REPLACE(EversparkNo1, '-', '')
this 1 i do in access query directly
You can run this query through vb also, you ned to execute a non query...
what is non query? Plzzzzz give me some examples...urgent..thanks
You can run this query through vb also, you ned to execute a non query...
What is a non query in vb 6.0 ???
Do anyone can help me in solve this problem. I need to update my column using query.
What is a non query in vb 6.0 ???
Does vb6 not have something simular to this debasisdas?, I use vb2005 and code such as: -
imports system.data.oledb
-
-
Dim oConn As New System.Data.OleDb.OleDbConnection(StrConn)
-
oConn.Close()
-
Dim con As New System.Data.OleDb.OleDbCommand
-
con.Connection = oConn
-
con.CommandType = CommandType.Text
-
con.CommandText = "Insert Statement"
-
oConn.Open()
-
con.ExecuteNonQuery()
-
Surely you can do something like this in vb6, right...?
There is nothing like non query in VB 6.0.
If you do not know the answer in the version that is clearly mentioned by the OP in the question, no need to post what you think is correct in higher version.
No need to post .NET replies to VB 6.0 questions.
Limit those to .NET forums only.
Mine is vb6 platform. Plz do help me in correct query to update my field. Plsssssssss i still finding 4 the answer......
try to use like this -
con.BeginTrans 'con is the ADODB connection object
-
con.Execute "your sql query here"
-
con.CommitTrans
-
Type mismatch error occur.Pls help me edit my coding down here.I need it urgently. Thanks in advance.....plzzzzzzzzz help me.
db_file = App.Path
If Right$(db_file, 1) <> "\" Then db_file = db_file & "\"
db_file = db_file & "Everspark2.mdb"
' Open a connection.
Set conn = New ADODB.Connection
conn.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & db_file & ";" & _
"Persist Security Info=False"
conn.Open
conn.BeginTrans
conn.Execute "UPDATE Alternator SET EversparkNo1 = REPLACE(EversparkNo1, " - ", "")"
conn.CommitTrans
undefine function 'REPLACE' in expression error also occur.
No body can help me???????????????plzzzzzzzzzzzz
try this - conn.BeginTrans
-
conn.Execute "UPDATE Alternator SET EversparkNo1 = " & REPLACE(EversparkNo1, " - ", "")
-
conn.CommitTrans
-
conn.BeginTrans
conn.Execute "UPDATE Alternator SET EversparkNo1 = " & Replace(EversparkNo1, " - ", "")
conn.CommitTrans
EversparkNo1 that i bold was not define eror....is it a variable? EversparkNo1 is a field in table. How to solve it. Plzzzzzzzz.....
if that is a field then what is the meaning of your update statment ?
i have one field which is Eversparkno1 where all its data got ' - ' now i want to remove the ' - ' to ' ' nothing, that means if 101-001 i want to change to 101001. so i want to do it by query, this replace successful if run directly in access but..now im doing in vb as a tools for query.
try to use this -
conn.BeginTrans
-
conn.Execute "UPDATE Alternator SET EversparkNo1 = select Replace(EversparkNo1, " - ", "") from Alternator
-
conn.CommitTrans
-
NOTE :-- Check for the quotes ' and "
Type dismatch error occur....plssssssss help me...next week i must present to my boss....
db_file = App.Path
If Right$(db_file, 1) <> "\" Then db_file = db_file & "\"
db_file = db_file & "Everspark2.mdb"
' Open a connection.
Set conn = New ADODB.Connection
conn.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & db_file & ";" & _
"Persist Security Info=False"
conn.Open
conn.BeginTrans
conn.Execute "UPDATE Alternator SET EversparkNo1 = SELECT REPLACE(EversparkNo1, " - ", "") FROM Alternator"
conn.CommitTrans
Anyone can help me?????? Plssssssss
Type dismatch error occur....
which line causes the error ?
conn.Execute "UPDATE Alternator SET EversparkNo1 = SELECT REPLACE(EversparkNo1, " - ", "") FROM Alternator"
this line got error
run the query directly in database and check if that works .
No, the query shows error. This query down here is success.....
UPDATE Alternator SET EversparkNo1 = REPLACE(EversparkNo1, " - ", " ")
why no one response to my question? plz help me ......i try a lot of way..but all error....
Hi,
Try This : -
conn.Execute "UPDATE Alternator SET EversparkNo1 = REPLACE(EversparkNo1, ' -', '') "
-
Regards
Veena
I had try..but Undefine function "REPLACE" in expression error occur. Please Help me.
I had try..but Undefine function "REPLACE" in expression error occur. Please Help me.
Hi Friend.
Please make sure that whether You have selected latest library or not regarding (DAO or ADO) so that library should support this function.
Please make sure that which version you are using.
Regards
Musai.
Hi,
Yes, "REPLACE" Function will not work with ADO,
Use a Combination of Left and MID and INSTR Functions..
Try This : -
conn.Execute "UPDATE Alternator SET " _
-
& " EversparkNo1 = Left(EversparkNo1,Val(InStr(EversparkNo1,'-')-1)) " _
-
& " Mid(EversparkNo1,Val(InStr(EversparkNo1,'-')+1)) " _
-
& " Where EversparkNo1 Like '%-%' "
-
Note: Only First Found "-" is replaced.
If you have multiple occurance of the same character,
say 3 times , then you need to run the same query thrice...
Regards
Veena
Hi,
Sorry, "&" was removed.. Try this one: -
conn.Execute "UPDATE Alternator SET " _
-
& " EversparkNo1 = Left(EversparkNo1,Val(InStr(EversparkNo1,'-')-1)) " _
-
& " & Mid(EversparkNo1,Val(InStr(EversparkNo1,'-')+1)) " _
-
& " Where EversparkNo1 Like '%-%' "
-
Regards
Veena
Sign in to post your reply or Sign up for a free account.
Similar topics
by: vnl |
last post by:
I'm trying to run a SQL query but can't find any records when trying to
select a certain date. Here's the sql:
SELECT field 1, field2, date_and_time,
FROM table1
WHERE date_and_time =...
|
by: Not4u |
last post by:
Hello
I have a SQL 2000 server, the server setting is default language :
French and all Collation names in French
If i launch the 'Query Analyzer' from the SQL Entreprise Manager on my...
|
by: Matt |
last post by:
If I open Enterprise Manager through a saved MSC file, the Tools > SQL
Query Analyzer option is greyed out (unavailable). If I open Enterprise
Manager from the Programs menu, Query Analyzer is...
|
by: Eagle |
last post by:
Hi all,
This one's drivin' me nuts. Any help would be appreciated. (Access 2000).
I have 3 tables:
tblTools: having the basic data of a tool and a field (txt) showing yes or
no with regard to...
|
by: Andy_Khosravi |
last post by:
My problem:
I'm having trouble with a query taking much too long to run; a query
without any criteria evaluating only 650 records takes over 300 seconds
to run (over the network. On local drive...
|
by: Dave |
last post by:
Using Enterprise Manager's toolbar - Tools / SQL Query Analyzer gives
me: "The specified file was not found". Same thing happens for Tools /
SQL Profiler.
But the apps will start just fine if I...
|
by: John Øllgård Jensen |
last post by:
Hi
Using MS Asccess 2000:
In a query I'm trying to create a new field with following expression:
FilmDate: Left(,4)
The field "FilmNo" is another text field in the query.
This is...
|
by: zwasdl |
last post by:
Hi,
I'm using MS Access to query against Oracle DB via ODBC. Is it
possible to use HINT in Access?
Thanks,
Wei
|
by: polyya |
last post by:
Hi All,
I'm working in Access 2000. Sorry for the long post, I'm trying to be as clear as possible.
I've created junction tables to express M:M relationships for contractors and job task. ...
|
by: mnjkahn via AccessMonster.com |
last post by:
I'm running Access 2003, modifying a query that has over 45 fields. When I
right click on the field name in Query Design View, and then click Build,
Access crashes before the Build window...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
| |