The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
		
			|  | 
			
		
			|  | 
				
					| Error while generating ID through slx_dbids proc  Posted: 10 May 07 9:30 PM
 |  
					| fiogf49gjkf0dHi Guys, 
 I am using following C# code to generate new id for the account table. This code is being called from an .aspx page.
 
 String conStr = "Provider=SLXOLEDB.1;Data Source=SLOGIX2;User ID=Admin
  assword=a:zzz;SLX Server=SLOGIX2;"; _slxConnection = new OleDbConnection(conStr);
 _slxConnection.Open();
 OleDbCommand cmd = new OleDbCommand("slx_dbids('Account', 1)", _slxConnection);
 ret = cmd.ExecuteScalar().ToString();
 _slxConnection.Close();
 
 I am consistently getting following exception:
 
 [AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]
 System.Data.Common.ICommandText.Execute(IntPtr pUnkOuter, Guid& riid, tagDBPARAMS pDBParams, IntPtr& pcRowsAffected, Object& ppRowset) +0
 System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) +103
 System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +192
 System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +48
 System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +106
 System.Data.OleDb.OleDbCommand.ExecuteScalar() +116
 
 Can someone help me troubleshoot what is wrong in my code? I have installed OLE DB Provider as well as sales logix client on the machine.
 
 Any help is highly appreciated.
 |  
					|  |  | 
			|  |  | 
			|  | 
				
					| Re: Error while generating ID through slx_dbids proc  Posted: 11 May 07 7:53 AM
 |  
					| fiogf49gjkf0dHi Rick, 
 Thanks for the response but all documentation I had read mentioned I need to call slx_dbids('Accoun',1). The article you are referring to also mentions to pass table name first and then the number of ids to generate.
 
 Thanks.
 
 |  
					|  |  | 
			|  |  | 
			|  |  | 
			|  | 
				
					| Re: Error while generating ID through slx_dbids proc  Posted: 11 May 07 4:06 PM
 |  
					| fiogf49gjkf0dHi Ryan, 
 My current connection string is
 
 String conStr = "Provider=SLXOLEDB.1;Data Source=SLOGIX2;User ID=Adminassword=a~zzz;SLX Server=SLOGIX2;";
 
 My password is actually a:zzz but I think forum converts :z into the similey face.
 
 When I compared this with what you have in the article I noticed following differences:
 1) Does password need to be in enclised in quotes?
 2) Are "Persist Security Info" and "Extended Properties" properties required?
 
 Please let me know what I am missing.
 
 
 
 
 |  
					|  |  | 
			|  | 
				
					| Re: Error while generating ID through slx_dbids proc  Posted: 11 May 07 4:20 PM
 |  
					| fiogf49gjkf0dThe password isn't the problem. Read the article again on the SLX connection string. There is no such parameter named "SLX Server" for SLX connection strings as you have in yours. You need to specify a SLX server with the "Data Source" parameter and the database (as defined on the SLX server) using the "Initial Catalog" parameter. 
 Make sense?
 |  
					|  |  | 
			|  |