View Single Post
 
Old 04-09-2014, 07:41 AM
JustinCase2 JustinCase2 is offline
Junior Contributor
 
Join Date: Apr 2006
Posts: 324
Default Bit hard to say

Not sure about this without seeing the actual datasource. But i think Your second attempt is the best one:

Code:
Dim myQuery As String = "INSERT INTO dbo.femtocell ([uploadID],[clientID],
[receiptNo],[compName],[state],[town],[district],[siteAddress],[latitude],
[longitude],[type],[serialNo],[man],[model],[pwr],[appNo],[manAntenna],
[modelAntenna],[height],[gain],[emission],[bhaul],[strucType],[covType],
[cov],[spectBand],[txFreq],[rxFreq],[bw],[regFee],[uspArea],[commDate],
[compName]) VALUES (SELECT 'username','client','noreceipt','comName',
[State],[Town],[District],[Site_Address],[Latitude],[Longitude],
[Equipment_Type],[Equipment_Serial_No],[Equipment_Man],
[Equipment_Model],[Equipment_Pwr_Mw],[Equipment_App_No],
[Antenna_Man],[Antenna_Model],[Antenna_Height_m],[Antenna_Gain_Db],
[antenna_emission],[Bhaul],[Struc_Type],[Cov_Type],[Cov_m],[Spect_Band],
[Tx_Freq_MHz],[Rx_Freq_MHz],[Bw_KHz],[Reg_Fee_RM],[USP_area],
[Comm_Date]FROM dbo.tempTable"
However Your INSERT statement has 1 more Field than the SELECT statement ([compName] is declared twize in the insert but not the Select). Not sure if thats the problem but its the only one i see ATM.
Reply With Quote