|
|
|
|
俵ÀÌ / 2000-02-10 / ¿ÀÀü 10:39:35 / 203.255.3.190
Á¶È¸¼ö : 122
|
[Áú¹®] [±Â ¸ð´× Áú¹®]auto increment?x) |
> Å×À̺íÀÇ Ç׸ñÁß¿¡ no¶ó´Â °íÀ¯ ¹øÈ£¸¦ Àû¾îÁÖ´Â Ç׸ñÀÌ ÀÖ½À´Ï´Ù.
>
> SQL¿¡¼ Å×ÀÌºí µðÀÚÀÎ ÇÒ¶§ ÀÚµ¿À¸·Î µ¥ÀÌŸ°¡ ÀԷµɶ§¸¶´Ù ÀÌ ¼ýÀÚ¸¦ 1¾¿ Áõ°¡ ½ÃÄÑÁÖ´Â ¼Ó¼ºÀÌ ÀÖ´ÂÁö¿ä...?
>
> ±×°Ô ÀÖÀ»°Í °°Àºµ¥ ¸ô¶ó¼ ¿ì¼± ASP¿¡¼ ÀÌ·¸°Ô Çغðŵç¿ä....
> ------------------------------------------------
> title1 = Request.Form("title1")
> title2 = Request.Form("title2")
> content=Replace(Request.Form("content"), "'", "''")
>
> Set DbCon = Server.CreateObject("ADODB.Connection")
> DbCon.Open("DSN=board;UID=sa;PWD=")
>
> strSql = " SELECT * FROM digital "
> Set rsList = DbCon.Execute(strSql)
>
> no= rsList("no")+1 <-¿ä±â!!
>
> strSql = " INSERT INTO digital "
> strSql = strSql & " ( no, title1,title2,content ) "
> strSql = strSql & " VALUES "
> strSql = strSql & " ( '" & no & "' ,'"
> strSql = strSql & title1 & "' ,'"
> strSql = strSql & title2 & "' ,'"
> strSql = strSql & content & "' ) "
>
> DbCon.Execute(strSql)
> ------------------------------------------------
> ÀÌ·¸°Ô Çß´õ´Ï óÀ½¸¸ 1ÀÌ ´õÇØÁö°í °è¼Ó 1À̳׿ä..^^
>
>
>
>
-----------------------------------------------------------
ÀÚµ¿ Áõ°¡¸¦ Çϱâ À§Çؼ´Â SQLÀ̶ó¸é IDENTITY Ç׸ñÀ» üũ ÇØ ÁÖ½Ã¸é µÉ°ÍÀÔ´Ï´Ù....
±×¸®°í °ªÀ» Áõ°¡ÇÏ·Á¸é wrote.asp¸¦ º¸½Ã¸é ÇØ´äÀ» ãÀ¸½Ç ¼ö ÀÖÀ»°Ì´Ï´Ù...
´Ô²²¼ ÇϽŠ¹æ¹ý´ë·Î Çϸé Á¦ÀÏ Ã³À½¿¡ ÀÖ´Â ·¹Äڵ常 °¡Á®¿À±â ¶§¹®¿¡...
Ç×»ó 1¸¸ °¡Á®¿À°Ô µÇ´Â °ÍÀÔ´Ï´Ù...
MAX ÇÔ¼ö¸¦ ÀÌ¿ëÇؼ °¡Àå Å« °ªÀ» ±¸ÇÏ´øÁö...
ORDER BY DESC¸¦ ¼ÒÆÃÀ» ÇÑ ´ÙÀ½ SELECT¸¦ ÇÏ½Ã¸é ¿øÇϽô °á°ú¸¦ ¾òÀ¸½Ç ¼ö ÀÖ½À´Ï´Ù...
Ã¥À» Çϳª »ç º¸½ÉÀÌ ¾î¶³Áö¿ä...
Å¿À´ÔÀÌ ¾²½Å taeyo's ASP¶õ Ã¥À» º¸¼¼¿ä...
Å¿À´ÔÀÌ ¾²½Å Ã¥Àε¥ ¾çÈ£ÇÑ°Í °°´õ±º¿ä... Àü ±×³É ´ëÃæ ÈÈ¾î º¸±â¸¸ ÇßÁö¸¸....
Å¿À´ÔÀÌ ¿¡·¯³ª´Â ºÎºÐÀº ÀÚ¼¼È÷ ¼³¸íµµ ÇØ Áֽôѱî¿ä...
´Ù¸¥ Ã¥ º¸´Ù´Â ÁÁÀ» °ÍÀÔ´Ï´Ù....
±×·³... ¼ö°íÇϼ¼¿ä.... ^^
|
|
|
|