none
Getting Blank Space error in ms access RRS feed

  • Question

  • Hi***

    I m koushik kumar. I have made a student database managment system using vb2008 & ms access 2007. My application page is on vb & storing the database into access. The problem is that when i am saving the data like stdid = '16101' , it saved into access as stdid = '_16101'. It means the id gets an automatic blank space_ before it. If i use this id in other tables like payment or exam, then this gets double blank space like (stdid='__16101').

    Please suggest me some ways to solve this,,,.

    Thanks in advance*****

    Friday, March 18, 2016 4:49 PM

Answers

  • Hi, kosek kumar

    >> I don't understand that if your data are numeric then why you are using Text datatype?

    it means that you are not using appropriate datatype to save your data. if you using a numeric datatype to save your data then it is possible that you not have to face with this kind of issue.

    >> I again tell you that if it is possible make a simple demo of your issue and provide us so that we can look in to that. without code we are not able to help you at this point because all the possibilities to solve this issue already suggested by the community members.

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 5, 2016 10:21 AM
    Moderator

All replies

  • I'm guessing your vb form is causing this. Access wouldn't add spaces on its own.

    Bill Mosca
    www.thatlldoit.com
    http://tech.groups.yahoo.com/group/MS_Access_Professionals

    Friday, March 18, 2016 9:19 PM
  • Hi, kosek kumar

    I am agree with Bill Mosca. In any way access will not add space before record data. It is possible that your code in VB adding this space. So check your code. Debug it to know at which step it adding the space. The another thing use Auto Number and primary key for the fields that contains ID like stdid. So that it will not generate any duplicate data and maintain your records properly.

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

    Monday, March 21, 2016 5:48 AM
    Moderator
  • Thanks for ur reply Deepak Sir**

    Actually ,,,it is creating the blank space on the studentid field,,and this field is the primary key . pleae suggest me a way

    Wednesday, March 23, 2016 7:04 PM
  • Thanks for ur reply Deepak Sir**

    Actually ,,,it is creating the blank space on the studentid field,,and this field is the primary key . pleae suggest me a way

    No one can suggest anything without seeing your code. As I said, Access database engine does not add spaces to the left of a string. There must be something in your code doing that. You have to debug that on your own.

    Bill Mosca
    www.thatlldoit.com
    http://tech.groups.yahoo.com/group/MS_Access_Professionals

    Wednesday, March 23, 2016 7:48 PM
  • Hi, kosek kumar

    I am totally agree with Bill Mosca, MVP.

    >> did you try to debug your code? did you find the place where space is added in student id?

    Regards

    Deepak 


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, March 24, 2016 4:13 AM
    Moderator
  • Hi Sir***

    i have cheked al my codes, there is no error in it ,,,i want to  know that " Is it can be a virus effect ".

    Sunday, March 27, 2016 6:52 PM
  • Hi, kosek kumar

    it will not give you any kind of error. when you debug your code at that time you have to check that what data are passes then you will find the problem.

    I really don't think that this problem is related to virus in any manner.

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 28, 2016 1:51 AM
    Moderator
  • Debugging is not just checking for errors. You have to step through each line as it executes and check the values of your variables to see where that space is being added.

    Bill Mosca
    www.thatlldoit.com
    http://tech.groups.yahoo.com/group/MS_Access_Professionals

    Monday, March 28, 2016 5:57 PM
  • If your stdid field is always going to be a number, the first thing to do would be to change its datatype to an appropriate Number type (Integer or Long Integer) in the Access database.  That would do away with any issues with spaces.  

    -Bruce

    Monday, March 28, 2016 8:32 PM
  • I can't find any error on my code,,and the problem is same till now. so i m going to create a new program.

    sir *** i have posted one more problem before a month ago,, it was about to save an image into access database by using ODBC data connection & codes. I want u to please check it and suggest me a way to solve it.

    i wll b thankful to UUUU***

    Saturday, April 2, 2016 5:02 PM
  • I can't find any error on my code,,and the problem is same till now. so i m going to create a new program.

    sir *** i have posted one more problem before a month ago,, it was about to save an image into access database by using ODBC data connection & codes. I want u to please check it and suggest me a way to solve it.

    i wll b thankful to UUUU***

    Saturday, April 2, 2016 5:04 PM
  • I can't find any error on my code,,and the problem is same till now. so i m going to create a new program.

    sir *** i have posted one more problem before a month ago,, it was about to save an image into access database by using ODBC data connection & codes. I want u to please check it and suggest me a way to solve it.

    i wll b thankful to UUUU***

    Saturday, April 2, 2016 5:04 PM
  • As already suggested, are you using the Auto Number type of data for your ID (primary Key)?

    Lauro

    Saturday, April 2, 2016 7:33 PM
  • Hi, kosek kumar

    >> I can't find any error on my code,,and the problem is same till now. so i m going to create a new program.

    As all the community members had already suggested you that it’s not an error then also everytime you mention that you can’t find the error.

    If the issue is still exist, can you able to provide your code and to steps to reproduce this issue at our side so that we can check what’s problem with your code.

    >> sir *** i have posted one more problem before a month ago, it was about to save an image into access database by using ODBC data connection & codes. I want u to please check it and suggest me a way to solve it.

    All the threads are independent with each other. From your description we are not able to get the idea about which thread you are talking. It is better to visit that thread again and post reply that you are still facing the issues with that problem. So that you can get possible help from our community members.

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, April 4, 2016 7:00 AM
    Moderator
  • No, the id code is not an auto number, its data type is text and this is a combination of  digits. Its look like '1603101,1603102,1603103'. where 16 is the year no. & 03 is the month(march).This code part is automatically generate  for each student. we only add 101,102,103 etc. we i save a profile with id 1603102, then after saving it. it becomes _1603102 .(_ means blank space). If i use this is id code to save an exam record, then it become    __1603102 (__ means double space). If i use this double spaced id for saving payment record , then it takes 3 blank spaces (___1603102). This is problem with me....
    Tuesday, April 5, 2016 10:04 AM
  • No, the id code is not an auto number, its data type is text and this is a combination of  digits. Its look like '1603101,1603102,1603103'. where 16 is the year no. & 03 is the month(march).This code part is automatically generate  for each student. we only add 101,102,103 etc. we i save a profile with id 1603102, then after saving it. it becomes _1603102 .(_ means blank space). If i use this is id code to save an exam record, then it become    __1603102 (__ means double space). If i use this double spaced id for saving payment record , then it takes 3 blank spaces (___1603102). This is problem with me....
    Tuesday, April 5, 2016 10:04 AM
  • Hi, kosek kumar

    >> I don't understand that if your data are numeric then why you are using Text datatype?

    it means that you are not using appropriate datatype to save your data. if you using a numeric datatype to save your data then it is possible that you not have to face with this kind of issue.

    >> I again tell you that if it is possible make a simple demo of your issue and provide us so that we can look in to that. without code we are not able to help you at this point because all the possibilities to solve this issue already suggested by the community members.

    Regards

    Deepak


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 5, 2016 10:21 AM
    Moderator