主页主页   最近新帖最近新帖  会员列表会员列表  搜索论坛搜索  帮助帮助   注册注册  登录登录
  最新论坛主题RSS2.0    最新发表RSS2.0    热门主题RSS2.0    全部精华  
学习交流区
 涂丫论坛 : 学习交流区
主题 主题: 数据导入、导出后编号不自动增长的解决 回复发表新帖
作者
内容 << 上一个主题 | 下一个主题 >>
ZeTa
Admin Group
Admin Group
头像
天下第一懒人

注册时间: 2003-12-28
所在地: China
在线状态: 离线
发帖数: 174
用户财富: 180
  • discovery [dis5kQvEri]  |  n.发现;被发现的事物  

  • 发表: 2006-04-20 11:57 | IP已记录 1引用 ZeTa

    前几天弄个网站,把程序和数据库从远程服务器拷到本机调试,数据库是这样传的:本机新建个sql注册,填上远程主机帐号,然后把远程主机的库导到我的本地主机。

    后来调试时发现所有的新建操作都出现如下错误:

    引用:

    Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'

    [Microsoft][ODBC SQL Server Driver][SQL Server]无法将 NULL 值插入列 'hid',表 'fujian.dbo.adminlist';该列不允许空值。INSERT 失败。

    /common/admin_areauser_save.asp,行 29

    上网查了才知道由于数据库导入导出后,id的值不会自动增长。网络上有几个方法:

    1.id允许为空

    2.修改数据库表

    3.用程序代码修改

     

    不过,第一种方法显然不适合我,因为删除的时候就是根据id删除的,id都为空了,我怎么删。

    第三种方法是这样的,给出高手们的解决方案,代码自行修改

    引用:
    select max(ID) as maxid form table
    id=rs("maxid")+1
    insert into project(id,code,name,linker,tel,flag) values(" & id & "'2002-12-19-001','而且','孙援军','58201188*190',0);

    说说我用的第二种,也是朋友教我的,我刚接触sqlserver。

    右键点击要修改的表----设计表-----

    这是原来的图:

    点击在新窗口查看

     

    更改后的

    点击在新窗口查看

     

    这样就可以咯。

    谢谢netkey的帮助。



    编辑 ZeTa - 2006-04-20 12:04


    __________________
    掩藏起卑微的身份,维持纯白的象征。
    停止愤恨,抛弃斗争,不去做谁的神。
    返回顶端 查看 ZeTa's 个人资料 搜索帖子 ZeTa 访问 ZeTa's 主页
     
    hww
    caiKer
    caiKer


    注册时间: 2006-05-11
    在线状态: 离线
    发帖数: 1
    用户财富: 5
  • goods [gudz]  |  n.货物,商品  

  • 发表: 2006-05-11 12:46 | IP已记录 2引用 hww

    非常感谢您的建议,看完后照做一遍果然解决了,非常感谢
    返回顶端 查看 hww's 个人资料 搜索帖子 hww
     
    wyc771108
    caiKer
    caiKer


    注册时间: 2009-05-20
    在线状态: 离线
    发帖数: 10
    用户财富: 50
  • might [mait]  |  n.力量,威力,能力  

  • 发表: 2010-03-25 22:44 | IP已记录 3引用 wyc771108

    Very Good!

    __________________
    blogsoft
    返回顶端 查看 wyc771108's 个人资料 搜索帖子 wyc771108 访问 wyc771108's 主页
     
    cunjin001
    caiKer
    caiKer


    注册时间: 2010-07-30
    在线状态: 离线
    发帖数: 1
    用户财富: 5
  • ours [5auEz]  |  pron.我们的  

  • 发表: 2010-07-30 16:05 | IP已记录 4引用 cunjin001

    Thirteen power strip years ago, truck crane before she mobile crane moved into road sweeper a home ignition unit with smaller work gloves closets, Ms. Fitzpatrick leather gloves purged her christian louboutin shoes wardrobe of pieces Christian Louboutin Pumps she no longer needed.

     

     

    As a Christian Louboutin Sandals result, Ms. Fitzpatrick Christian Louboutin Slingbacks now makes  Christian Louboutin Boots sure to christian louboutin shoes hold onto Christian Louboutin Pumps beloved pieces Christian Louboutin Slingbacks that are Christian Louboutin Boots in good Christian Louboutin Sandals shape.

    返回顶端 查看 cunjin001's 个人资料 搜索帖子 cunjin001
     
    jmjm123
    caiKer
    caiKer


    注册时间: 2010-08-11
    所在地: Bahamas
    在线状态: 离线
    发帖数: 21
    用户财富: 105
  • seed [si:d]  |  n.种(子),籽,萌芽  

  • 发表: 2010-08-11 16:37 | IP已记录 5引用 jmjm123

    Best <a href="http://www.sale4louisvuitton.com/articles/louis-vuitton-purses.html"  tItlE="Louis Vuitton purses">Louis Vuitton purses</a> online. ...
    best <a href="http://www.cheaperchanel.com/">chanel</a> sale
    best gucci bags
    Best TIFFANY JEWELRY online sale and replica handbags
    Best Louis Vuitton purses online. ...
    best chanel sale
    返回顶端 查看 jmjm123's 个人资料 搜索帖子 jmjm123 访问 jmjm123's 主页
     
    jmjm123
    caiKer
    caiKer


    注册时间: 2010-08-11
    所在地: Bahamas
    在线状态: 离线
    发帖数: 21
    用户财富: 105
  • slavery [5sleivEri]  |  n.奴隶制度;苦役  

  • 发表: 2010-08-13 08:10 | IP已记录 6引用 jmjm123




    gucci handbags, one of the most fashionable chanel bags,Gucci bags has a long history,so Gucci handbags produced from Boston,We are the lowest price replica balenciagaa Handbags supplier.Replica louis vuitton handbags (LV Handbags) 90% OFF on sale. Louis Vuitton Designer handbags and Louis Vuitton Replica Bags many style, 24/7 live service!

    返回顶端 查看 jmjm123's 个人资料 搜索帖子 jmjm123 访问 jmjm123's 主页
     

    如果您想回复本帖,您首先必须 登录
    如果您还没有注册,您首先必须 注册

      回复发表新帖
    打印版本 打印版本

    论坛跳转
    不能 在此发表新帖
    不能 在此发表回复
    不能 删除本人发帖
    不能 编辑本人发帖
    不能 在此发起投票
    不能 在此参加投票

    Powered by Web Wiz Forums version 7.92 [WWF中文网美化增加版V1.0]
    Copyright ©2001-2004 Web Wiz Guide

    本页处理时间为 .2188 秒