NBS Posted October 7, 2008 Report Share Posted October 7, 2008 query = "INSERT INTO financest (custom_ID, device_NR, subsfee) VALUES ('"& customid &"', "& request("devid") &", "& request("subsfee") &")" response.write(query) link.execute(query) Izvadās INSERT query. query = "SELECT @@IDENTITY AS financ_ID" response.write(query) set exe = link.execute(query) response.write(exe("financ_ID")) Neizvadās financ_ID. Neiegūstu IDENTITY. Palīdziet, lūdzu. Link to comment Share on other sites More sharing options...
andrisp Posted October 7, 2008 Report Share Posted October 7, 2008 query = "SELECT 100 AS financ_ID" šitā kaut ko izdrukā ? Link to comment Share on other sites More sharing options...
NBS Posted October 7, 2008 Author Report Share Posted October 7, 2008 query = "SELECT 100 AS financ_ID" šitā kaut ko izdrukā ? Jā izvada 100. Link to comment Share on other sites More sharing options...
andrisp Posted October 7, 2008 Report Share Posted October 7, 2008 (edited) Esi pārliecināts, ka iekš Access db tāda fiška kā @@IDENTITY vispār ir ? Es zinu, ka tas ir priekš MSSQL. http://www.google.com/search?hl=en&q=a...+last+insert+id Edited October 7, 2008 by andrisp Link to comment Share on other sites More sharing options...
NBS Posted October 7, 2008 Author Report Share Posted October 7, 2008 Esi pārliecināts, ka iekš Access db tāda fiška kā @@IDENTITY vispār ir ? Es zinu, ka tas ir priekš MSSQL. http://www.google.com/search?hl=en&q=a...+last+insert+id Es tieši izmantoju MSSQL un palaižot iekšs SQL Query Analyzer: INSERT INTO financest (custom_ID, device_NR, subsfee) VALUES ('270785', 1, 10.6) SELECT @@IDENTITY AS financ_ID Viss forši strādā :( Link to comment Share on other sites More sharing options...
NBS Posted October 7, 2008 Author Report Share Posted October 7, 2008 Ir kādas idejas kpc tā ? Link to comment Share on other sites More sharing options...
NBS Posted October 7, 2008 Author Report Share Posted October 7, 2008 Uzrakstot pat šādu kodu atgriež abos gadījumos tukšumus :( query = "SELECT @@IDENTITY AS financ_ID1" set exe = link.execute(query) response.write("financ_ID1: ") response.write(exe("financ_ID1")) query = "SELECT SCOPE_IDENTITY() AS financ_ID2" set hm = link.execute(query) response.write("financ_ID2: ") response.write(hm("financ_ID2")) Link to comment Share on other sites More sharing options...
NBS Posted October 8, 2008 Author Report Share Posted October 8, 2008 Atrisināju problēmu, iepriekšējais query nebija aizvērts, kas tika izsaukts skripta sākumā. Dīvaini it kā nevajadzēja būt problēmas ar to, bet tomēr traucēja tam kaut kas. Link to comment Share on other sites More sharing options...
Recommended Posts