|
hello,
i'm doing project 'check status bus express via SMS'. the connection is between handphone and GSM modem.right now,i didnt know how to search the database in MS Access using gsm modem(FARGO MAESTRO 100).
If i in wrong forum,can someone point out which forum should i entered..
with regard,
ieyra
|
|
|
|
|
Hello I have problem deleting rows
Below is the function I call when the user explicitely ask updade for it's changes
The dataset is the datasource of a datagridview
The first time the function is called it works fine
But if it is called a second time with the same datagrid view I got the error
{"Concurrency violation: the DeleteCommand affected 0 of the expected 1 records."}
But if I make another select between the two call : no error
I probabely miss something ?
private void do_update()<br />
{<br />
<br />
MySqlCommandBuilder cb = new MySqlCommandBuilder(adaAddr);<br />
<br />
DataSet ch = new DataSet();<br />
ch = dsAddr.GetChanges(DataRowState.Deleted);<br />
if (null != ch)<br />
{<br />
int del=adaAddr.Update(ch);
lbl_delcnt.Text = del.ToString();<br />
}<br />
<br />
ch = dsAddr.GetChanges(DataRowState.Modified);<br />
if (ch != null)<br />
{<br />
int upd=adaAddr.Update(ch);<br />
lbl_updcnt.Text = upd.ToString();<br />
}<br />
<br />
ch = dsAddr.GetChanges(DataRowState.Added);<br />
if (ch != null)<br />
{<br />
int add=adaAddr.Update(ch);<br />
lbl_addcnt.Text = add.ToString();<br />
}<br />
<br />
MySqlCommand cmd = new MySqlCommand("DELETE from tours where addrID not in ( select addrID from address );", conn);<br />
int tourdel=cmd.ExecuteNonQuery();<br />
lbl_deltourcnt.Text = tourdel.ToString();<br />
<br />
return;
|
|
|
|
|
Hi Guys,
Accedientally i delted a record in table when i was trying to do it on a temporary table.How do i recover the data in the table.Could you please let me know to ROll Back my data in table.
Your help is much appreciated.
Thank you
Kibrom
|
|
|
|
|
Did you take regular backups of your database? If so, restore from the last backup.
If not, then you've lost it forever. Maybe this will teach you the importance of taking regular backups.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hello there guys.
Im experiencing a problem with an update statement and this is the error I get when trying to log into my website.
Error Occured:
Error # -2147467259 Operation must use an updateable query.
SQL = UPDATE tbl_employees SET lastlogin = #28-Feb-2008# WHERE employeelogin = 'SIPHOSIBUYANE'
I tried to check the permission(They are correct), files(They are in the right places).Now I dont knw what could be the problem.
Here is the update statement.
Private function RunSQL(ByVal sql,ByRef myRS)
'Response.Write sql & " "
On Error Resume Next
if lcase(left(trim(sql),6)) = "select" then
set myRS = server.CreateObject("adodb.recordset")
myRS.open sql,conn,3,3
else
select case lcase(left(trim(sql),6))
case "update", "delete"
if instr(lcase(sql),"where") = 0 then
response.write "Dork, you tried to run a "& lcase(left(trim(sql),6)) &" query without the where clause!"
boolDoNotRunQuery = true
response.end
end if
end select
if boolDoNotRunQuery <> true then
set myRS = conn.Execute(sql)
end if
end if
if err.number <> 0 then
Response.Clear
Response.Write "Error Occured:
"
Response.Write "Error # " & CStr(Err.Number) & " " & Err.Description & " "
Response.Write "SQL = " & sql & " "
Response.End
End if
On Error Goto 0
end Function
Private function DoSQL(ByVal sql)
'Response.write sql & " "
On Error Resume Next
boolDoNotRunQuery = FALSE
actionWord = left(trim(sql),6)
select case lcase(actionWord)
case "update", "delete"
if instr(lcase(sql),"where") = 0 then
response.write "Dork, you tried to run a "& lcase(left(trim(sql),6)) &" query without the where clause!"
boolDoNotRunQuery = true
response.end
end if
end select
kagiso
|
|
|
|
|
This site is working fine from the server and on the computer(Local host), so I only copied the files across to the ftp folder of the web hosting company and the problem begun.
What should I do??
Thanx in advance.
kagiso
|
|
|
|
|
REMOTE is a Linked Server on HEADOFFICE
When I execute this T-SQL script on HEADOFFICE to test the connection :-
SET XACT_ABORT ON<br />
begin distributed tran<br />
select * from REMOTE.master.sys.sysprocesses<br />
commit tran<br />
SET XACT_ABORT OFF
I get the following error message :-
Msg 8501, Level 16, State 2, Line 1<br />
MSDTC on server 'REMOTE' is unavailable.
Both servers have DTC running and I checked that the firewalls have ports 1433 and 1434 open.
Any ideas would be appreicated.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Hi,
can any one tell me what is the Difference between SQLSERVER 2000 and SQLSERVER 2005
With Regards,
Anu
|
|
|
|
|
|
|
there is a big difference of 5...
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y<p?jxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
i want to delete the record from datagrid using sqlcommandbuilder.getdelete command,
after selecting a pericular record from datagrid the record should be deleted.how it is possible.
weather i have to provide some parameter if yes then what is the syntax to provide .please help me.
|
|
|
|
|
I would like to know how I can set a new value into the triggers inserted recordset. Example: All dates on or before 1/1/1900 are to be set to null. Then a date in the fourth column comes in as 1/1/1900 in the inserted column. I can find out that the value needs to be set, but how can I change it to null before it is actually set in the database?
Thanks,
Leo T. Smith
Program/Analyst Supervisor
|
|
|
|
|
You could use an INSTEAD OF UPDATE trigger that fires when an UPDATE statement is executed against your table. The inserted table would contain details of the changes which were going to be made. You can then examine these values and execute a different UPDATE statement which either updates the fields as they were originally going to be updated, or sets fields to NULL where the value <= 1/1/1900.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I have a Access Form, with a series of three combo boxes.
Box 1 - City
Box 2 - State
Box 3 - ZIP
When I input the zip code, I want to populate the other two boxes based on the result of the ZIP code. I have a ZIP codee table, which has ZIP, CITY, and a second table that has State.
How should I write the query in order to accomplish this?
Thanks,
|
|
|
|
|
You can obtain the City by doing a simple SELECT on your ZIP Code table, filtering on the ZIP.
You haven't explained how your tables are related. I assume you have a City table with a foreign key to the State table. If so, write a query which joins the ZIP Code, City and State tables and fetches the corresponding State description.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hello Paul, and thank you for your response.
I need to get better explaining my brainstorming!
Ok, the Zipcode table has Zipcode, City, State Code fields. The State Table has State Code, State Abrieviation, and State Name. The two tables are related by the State Code field.
I would think that if I enter the zip, then perform an after update event that queries the Zipcode table and populates the State field of the form.
So, with the above in mind, would you think that this query would work?
SELECT [ZIP Codes].[City], [States].[State Abbreviation]
FROM [ZIP Codes], States
WHERE [Zip Codes].[ZIP Code] = '44107' and
[States].[State Code] = (SELECT [ZIP Codes].[State Code] FROM [ZIP Codes] WHERE [ZIP Codes].[ZIP Code] = '44107')
ORDER BY [ZIP Codes].[ZIP Code];
Thanks,
|
|
|
|
|
solutionsville wrote: SELECT [ZIP Codes].[City], [States].[State Abbreviation]
FROM [ZIP Codes], States
WHERE [Zip Codes].[ZIP Code] = '44107' and
[States].[State Code] = (SELECT [ZIP Codes].[State Code] FROM [ZIP Codes] WHERE [ZIP Codes].[ZIP Code] = '44107')
ORDER BY [ZIP Codes].[ZIP Code];
Your query is overly complicated and can be simplified to:
SELECT [ZIP Codes].[City], [States].[State Abbreviation]
FROM [ZIP Codes]
INNER JOIN [States]
ON [ZIP Codes].[State Code] = [States].[State Code]
WHERE [ZIP Codes].[ZIP Code] = '44107'
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thanks Paul.
I Appreciate it.
Brian
|
|
|
|
|
Here's a tip for you. Use the Access Query design to do you table links etc, then look at query as SQL Statement and there's the required code.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
I want use ADO to get the field’s data type not the ADO’s data type but the database’s data type like ‘varchar’,’ char’.
|
|
|
|
|
You can obtain field metadata by querying the INFORMATION_SCHEMA.COLUMNS system view in the master database on your SQL Server.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
No,I mean not only the SQL Server but also other kinds of database.
|
|
|
|
|
I doubt that this is possible.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi,
Sql server does not support ntext in function.
Is there any way to use ntext in function?
I have a condition where a ntext column value if not exist in one table then i have to select it fom another table.
Thanks in Advance
|
|
|
|